Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


CJK last won the day on October 6

CJK had the most liked content!

About CJK

  • Rank

Contact Methods

  • Website URL

Profile Information

  • Location

Recent Profile Visitors

293 profile views
  1. Can you be more specific ? In what way doesn't it work ? Or, put another way, what precise result should you be getting, and what precise result are you getting now ? "Doesn't work" can range from the script failing to execute at all because of an error during compile time; or the script running but returning no result; or the script not recognising the command names; or a host of other possibilities. Perhaps you could upload one of your workflows where this problem can be seen first hand, and someone could help diagnose the cause for you ?
  2. Perhaps. But that's missing the point. It doesn't matter for now, if I can collect my thoughts on the matter, I'll put together a feature request post. Then again, I might not. I shouldn't think AppleScript will be prioritised anyway, given how painfully it's dying.
  3. I think you're going to need to resort to a GUI check, sadly. On this note, I really do think Alfred would benefit from more AppleScripting terminology, to include things such as whether the Alfred search bar is active or not, or to automate editing features of multiple workflows (a workflow object would be very useful).
  4. Yes, I've wanted to do this in the past, but ran into difficulty. Although there's the option to have a hotkey only active when a particular app has focus, this only means that the hotkey won't do anything outside of that app; it doesn't mean the hotkey is available to be used by other apps to trigger their workflows. This is really irksome, because it severely limits the amount of hotkey "real estate" one has to play with—double tapping the Command key is such a useful trigger, but with Alfred, I can only get it to serve a single purpose (thankfully, I have Keyboard Maestro installed, so I use that to apply multiple actions to a single keyboard trigger depending on different factors).
  5. CJK

    Can Alfred search the Mac Keychain

    Yes, e.g.: var app = Application('Usable Keychain Scripting') app.currentKeychain.keychainItems.whose({name: {_contains: 'CK'} })() I don't have Mojave but I'm hearing lots and lots of reports that it's ballsed everything up for AppleScripters, particularly as it no longer permits the use of scripting additions (people wonder why I never use them, and this is why). However, as the Usable Keychain Scripting is an application, it can be scripted just like any other scriptable application that one downloads.
  6. Hi @Bhishan, Here's the equivalent code for Chrome that closes all windows and all tabs except the currently active one: use Chrome : application "Google Chrome" property |windows| : a reference to every window of Chrome property |tabs| : a reference to every tab of |windows| property tab : a reference to the active tab of Chrome's front window close (|tabs| where its id ≠ id of my tab) It's very similar to the Safari code, but Chrome requires that comparing tabs is done via their id property rather than directly as object references.
  7. I wish you had asked this in your initial question. It's extra work to go back and test a script in different situations after the fact, rather than had I known and been able to do the testing all at once. I'm too tired to go and test anything for Chrome, but it would involve changing current tab to active tab, and utilising the id property of my tab to exclude it from the enumerated list of id of |tabs|. Play around with it and just do trial-by-error. That's what we all do. Regarding Firefox, it won't work. Firefox isn't scriptable (to any useful extent). I'll check back in a couple of days and post a working solution for Chrome if you haven't got it figured out by then. Next time, please include all your related needs in a single post. Obviously, very disparate issues are still best posted as separate posts.
  8. CJK

    Can Alfred search the Mac Keychain

    AppleScript's "KeyChain Access" is pretty terrible. However, the kind bloke(s) at Red-Sweater software (maker of FastScripts) have made a scripting addition aptly referred to as the Usable Keychain Scripting It allows you to search using whose filters as with other enumerated AppleScript collections, e.g. tell application "Usable Keychain Scripting" to tell ¬ the current keychain to get the ¬ password of every internet password ¬ whose name contains "google.com"
  9. You could try this: use Safari : application "Safari" property |windows| : a reference to every window of Safari property |tabs| : a reference to every tab of |windows| property tab : a reference to the current tab of Safari's front window close (|tabs| where it ≠ my tab) I haven't really tested it though as I currently have a gajillion tabs open that I don't particularly want to close. Also, don't use the Run NSAppleScript action. Use the Run Script action and select /usr/bin/osascript (AS) as the chosen language.
  10. @Bhishan, this is the general form the AppleScript code will take when trying to access a menu bar icon and its menu: use application "System Events" property P : a reference to the process named "Mathpix Snipping Tool" property M : a reference to menu bar item 1 of menu bar 2 of P property I : a reference to the menu item named "Get LaTeX" of menu 1 of M click M click I It doesn't work for every single menu bar application, and there's an annoying 5-second delay between the first click command and the second. This is a known, persistent feature that has various documented so-called solutions, none of which are reliable, but you can have a Google and see what works for you. Don't forget to make sure Terminal (or whichever program is executing the above script) has accessibility privileges granted to it.
  11. I was just brainstorming out loud. I wasn't suggesting that as an actual final solution. But when I mentioned a wrapper of some sort, I just remembered that there's a site called https://itty.bitty.site that does something along these lines. I actually used them for my homepage since I have no hosting space. Basically, it encodes and decodes a webpage up to the length of about 2000KB into a URL, which then circumvents the need to have small web pages hosted at all. But, anyway, this is a digression. I'll have a look at vitor's repo, cheers for the link... EDIT: ...which I've now done. It's a good interim solution for sure. I'll do that from now on. Thanks for pointing me there.
  12. Saw this remark from a while ago, and things may have changed. What method do you use to adjust this setting ?
  13. I'll endeavour to sort something out for future contributions, however all of my current cloud storage solutions are also set to sync with my local laptop hard drive. This means any workflow I share through these would need to remain there and also on my hard drive, as a duplicate of the one that already exists (the original). May I ask how you manage this situation for yourself ? The other issue with cloud storage solutions is that links can break easily simply by renaming or moving a file when one reorganises. So I imagine that's another issue for the Alfred forum even for seemingly "permanent" links. I wonder if there's a superior solution that bypasses the need for links and cloud storage. Perhaps along the lines of encoding the workflow file in base64 and pasting the output on the Alfred forum as text (but ideally with a more user-friendly wrapper for those who wouldn't feel able to decode base64, not to mention the absurd-looking forum posts we'd start seeing). I rrrrrrreally wish the Alfred forum was a Discourse forum.
  14. @MrAu, Here's my humble offering, which may be no better or no worse than any others. The workflow is downloadable here and will available for the next 30 days at which point the link expires. Here's a screenshot of the workflow: As you can see, it's very straightforward, so not much can go wrong.
  15. [background=#eee][font=courier,monospace]sample inline code typeface[/font][/background] should render as sample inline code typeface. This font is Menlo