• Tech Tips

    Customizable Date variables in Keyboard Maestro

    UPDATE: Though the solution below works well, I do recommend following the first commenter’s advice and using the ICUDateTime text tokens instead, which allow you to use any ICU date format, without having to invoke a shell script.

    Sometimes you need a date and/or time variable in your Keyboard Maestro macros. The easiest One way I’ve found to do this is via an “Execute Shell Script” action. You’ll just use the date command and format as desired.

    Keyboard Maestro "Date" Variable

  • Tech Tips

    Keyboard Maestro – It’s the Little Things

    I’ve been using Keyboard Maestro to make myself more efficient. Even the littlest things can (and should) be automated to save time.

    I spend a good portion of my day navigating directories in iTerm. Often I find myself jumping up a directory (back) and then listing the directories to get my bearings.

    In about 30 seconds I made myself a quick hotkey that will be active during iTerm sessions (it’s within my iTerm group, which is only active for the iTerm application) and will perform both operations (cd .. and ls). I mapped this to CMD-u which I think of as “up” so it’s easy to remember. Notice there is a return (linebreak) after the ls; this will simulate hitting return, which will execute the preceding commands. I could have added a return keystroke action, but this is just faster and requires less actions.

    I encourage you, if you’re a KM user, to think about the little things and figure out where you could shave off keystrokes, mouse clicks, etc. to make yourself as efficient as possible.

    km-cd-ls

  • Tech Tips

    Keyboard Maestro – Paste into Vim (with formatting)

    Vim users frequently run   :set paste  and :set nopaste . Using paste mode makes it simple to paste text while maintaining whitespace, but some other aspects of Vim are reset in paste mode (e.g., autoindent and smartindent). I’m sure there’s a way to make it easier to flip back and forth within Vim (via .vimrc), but if you want a universal way to do this, regardless of the Vim settings that are in place, you may find the following Keyboard Maestro macro helpful.

  • Tech Tips

    Keyboard Maestro – Alfred Integration

    alfredmaestroI’ve been using the Alfred Maestro workflow for a bit now. It’s very nice to be able to call Keyboard Maestro macros via Alfred.

    It took me some time to figure out why some of my macros weren’t available in Alfred.

    Make sure that if your macro group (or macro) is setup to be Available in the following applications that you include Alfred 2 in the list. Also, if you need the macro group or macro to be available in the KM built-in Trigger macro by name you should include Keyboard Maestro as well.

  • Tech Tips

    Keyboard Maestro – Simple GUI for a Command-line App

    Keyboard Maestro is now an integral part of my workflow throughout the day. I’ve found one particularly helpful use for it is to build very simple GUIs for command-line applications. In the example here I am showing how I use Keyboard Maestro to build a simple GUI for a Python script I wrote called dummyimage.py [see project on github]. Here’s the official description of the script:

  • Tech Tips

    Keyboard Maestro – Directory Prompt

    Keyboard Maestro seems to have every option I can possibly think of, with the exception of “Prompt the user for a directory” or “Prompt the user for a file”. It is entirely possible I’m just missing it.

    Here’s how I accomplish the directory prompt:

    km-prompt-directory