Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


CJK last won the day on December 10

CJK had the most liked content!

About CJK

  • Rank

Contact Methods

  • Website URL

Profile Information

  • Location

Recent Profile Visitors

373 profile views
  1. Have a look for yourself: Those are three of the time-related triggers: the top one (cron entry) gives you fine, precision control over when to run a macro (the equivalent in Keyboard Maestro of a workflow in Alfred), down to the times, which days of the week in which months and in which years, and absurd patterns like whenever the 14th of the month falls on a Sunday, or stuff like that (I currently have it set to 7PM daily); the second trigger there is the periodic trigger, that executes the macro at regular intervals on selected days; and the last one is simply a set time on selected days. Other time-related ones (or system-event driven ones, really) allow you to trigger macros when the computer is simply idle (i.e. not being used); when the computer wakes up from sleep; or just before is goes to sleep. Then there are triggers for when the wifi network changes, the audio output device changes, folder contents change, a USB device is inserted, a hotkey is pressed, etc. The one main trigger is lacks is a good mouse trigger, for which Better Touch Tool is the go-to application for mouse-driven automation. Regarding actions, Keyboard Maestro can interface with iTunes, interface with Chrome/Safari, press buttons or menu items of specific applications without needed them to be focussed, run scripts (Swift, JavaScript, AppleScript, shell), detect images on screen (pixel matching—some people find this useful for identifying objects to click on that don't have names, but I personally loathe any sort of automation that involves simulating keypresses or mouse clicks), manipulate windows, and a bunch of other stuff. There's a good Wiki that explains all of the features in detail. Given how your expectations for Alfred weren't met before you paid for it, I'd suggest this time doing in-depth research before you invest in buying Keyboard Maestro or any other software (a good rule of life, in general). I believe KM has a trial period that allows you to use it for free so you can see if it does what you need.
  2. Let me save everyone a 97MB slow download of a 1-minute video that could easily have been a 3-second GIF, that could easily have just been some words: when launching Chrome in incognito mode via the workflow being discussed in this thread, it does, indeed, open an incognito Chrome window, but also appears to open a normal Chrome window behind it.
  3. So that has approximately zero percent chance of long-term success. I think the app you were after was probably Keyboard Maestro and not Alfred.
  4. Is the cat named Alfred ? My eyeballs will roll so hard they'll leave my face if this is so.
  5. Sorry, I see now that your original script returns the basename. I mistook it originally for returning the full path, so engineered my version of the script to do the same. It's one small modification in the way I declared the variable fp, and concatenated it with $name from the outset. Instead, we'll just keep them as two separate variables, so $fp will contain the file path to the containing folder, and $name will contain the basename that you're after: fp=$(osascript -e \ "tell app \"Finder\" to get insertion location as alias return the result's POSIX path") screencapture -i -x "$fp$name.png" # copy final path to clipboard printf '%s' "$name.png" | pbcopy
  6. In fact, this is your combined script just as a straight copy-n-paste (it obviously won't function yet because of the naked AppleScript code): screencapture -i -x ${HOME}/Dropbox/KeepMe/KeepScreenshot/$(date +%Y-%m-%d-%H-%M-%S).png # rename sleep 5 a=${HOME}/Dropbox/KeepMe/KeepScreenshot/*.png /bin/mv $a ${HOME}/Dropbox/KeepMe/KeepScreenshot/${name}.png tell application "Finder" if exists Finder window 1 then set currentDir to target of Finder window 1 as alias else set currentDir to desktop as alias end if end tell return POSIX path of currentDir # cd to cwd cd $1 # move png to cwd /bin/mv ${HOME}/Dropbox/KeepMe/KeepScreenshot/${name}.png ${name}.png # copy final path to clipboard pbcopy < ${name}.png There's a lot of renaming/moving and so forth going on, and I'm wondering whether it would have been easier just to set the destination path straight away when taking the screen capture. That way, the entire script above gets reduced to this: fp=$(osascript -e \ "tell app \"Finder\" to get insertion location as alias return the result's POSIX path")$name.png screencapture -i -x "$fp" # copy final path to clipboard printf '%s' "$fp" | pbcopy
  7. Having had a brief look at the workflow and the bash scripts, my guess is that when you substitute in "Google Drive", you're not using quotes to enclose the full file path, e.g. where you have, in one script: /bin/mv $a ${HOME}/Dropbox/KeepMe/KeepScreenshot/${name}.png would be better if it were: /bin/mv "$a" "${HOME}/Dropbox/KeepMe/KeepScreenshot/${name}.png" My other suggestion, though unrelated to your present dilemma, is that you combine your four Run Script actions into a single action. It doesn't make much sense to have them separate, and it'll make debugging easier too.
  8. CJK

    Simplify fractions

    Nice idea and workflow. You could maybe think about expanding its capabilities to become a more general maths tool. From simplifying fractions, it's not a big leap to incorporate GCD and LCM. And then, maybe, handling/simplifying surds, expressing compound fractions, obtaining the integer or fractional portions of a number, and coping with modular arithmetic. Just thinking out loud. Thanks for the sharing this.
  9. Nope. The script isn't presented as achieving any particular objective; it doesn't really do anything in its current state. It's just a triplet of related code snippets that demonstrate how to retrieve their respective bits of information, and I just failed to properly segregate or itemise them. So in this example, what's the snippet trigger doing that a keyword list filter isn't ? If a list filter contained all the emojis, then they would get shown by typing a single keyword, no ?
  10. I have noticed that there's a Snippet Trigger, which I assume allows one to create a keyword shortcut that acts as a snippet, expanding to whatever result of the ensuing workflow yields. Is that anywhere close to how it works ? If so, an off-the-top-of-my-head idea and without much firsthand experience using Alfred snippets (I use Typinator), makes it seem to me that it might be possible to create snippets that share a common abbreviation/keyword, but—through a multi-pronged workflow that incorporates a tiny bit of scripting—could expand to produce something that depends entirely upon the currently selected keyboard input source. I'm not the best person to play around with this, as I'm monolingual. However, I have put together a few lines of key Javascript for Automation (JXA) code that would prove useful if anyone else wanted to see what they can do to make snippets more flexible or less likely to clash for multilingual persons: ObjC.import('AppKit'); inputContext = $.NSTextInputContext.currentInputContext; inputSources = ObjC.deepUnwrap(inputContext.keyboardInputSources); inputSource = ObjC.unwrap(inputContext.selectedKeyboardInputSource); //--> "com.apple.keylayout.British" localisedName = ObjC.unwrap( $.NSTextInputContext .localizedNameForInputSource(inputSource) ); //--> "British" I've printed example values for the last two variables, which are actual values returned on my system. The other value of possible interest is the variable inputSources, which produces a list of available input sources, mirroring what appears listed in the input menu if you have it accessible from the menu bar.
  11. I think this a good suggestion that would push Alfred progressively forward in line with competitors of similar ilk. Can Alexa execute commands via SSH ? In the interim, you could possibly achieve a similar result if you were able to get Alexa to run an osascript command over SSH into your machine.
  12. Not a complete solution, but this establishes a hotkey that takes highlighted text in Safari, runs it through your regex, then sends the result to the clipboard. Here, I've elected to use 〈Ctrl〉+〈C〉 as a close relative of 〈Cmd〉+〈C〉.
  13.  Could be Invision Power Board's slogan, tb Megalolz.
  14. You could use the Transform utility to edit it.
  15. So your workflow is set up exactly the same as mine, and now using exactly the same script. Yet yours presents with a 5-second delay in _Alfred_, and mine does not. This might suggest that it's something specific to your system that is creating the delay. You could try debugging the workflow. Mine didn't reveal anything interesting, so if yours does, that might be a clue. Otherwise, see if anyone who knows more than I chimes in with some suggestions or ideas.