This macro set was originally released on chauncey.io.

Inspiration and Rationale

Inspiration for QuickCursor for Keyboard Maestro (QuickCursorKM) comes from the deprecated QuickCursor (killed by sandboxing) and tjluoma’s replacement, edit-anywhere. Thank you tjluoma for the inspiration for this macro set!

Text typically flows easily. However, there are those moments when it just. Gets. Stuck. QuickCursorKM is there to undo that log-jam by redirecting your text-flow to a better editor. A good example: say you’ve made a list of things but forgot to add a hyphen (-) for Markdown formatting. No worries! Activate QuickCursorKM, edit the text in MacVim1, and you’re on your way.

Creation and Extensibility

I’ve designed this Keyboard Maestro macro set with two types of macros:

  • Builder macros with specific, iterative actions (indicated by an underscore and disabled by default) AND
  • Editor macros that set or determine the editor you wish to use.

The final editor macro used by the end user is comprised of these builder macros. Built this way, the macro-program is easily extensible and updated.2

You, however, need do nothing but choose a shortcut for the editor macros you wish to use.3 You’ll also want to disable any of the editor-specific macros that you don’t use.

Alternatively, you can just use the QuickCursorKM macro itself and it’ll open the text in the system default editor for txt files.

Additionally, in the macro QuickCursorKM, you may assign your favorite editor to open while selecting text from a specific application. For example, I may want to use Byword for Safari forms but edit a list I started in Pages with MacVim. To my knowledge, no other QuickCursor alternative does this! See the default macro for examples of how to add additional editor assignments.

Usage

To use QuickCursorKM, place your cursor on some text. If you select specific text, that text is captured; otherwise, if no text is selected, all available text is edited.

  • Run the macro QuickCursorKM (or one of the editor-specific variants4) with your hotkey. The text will open in your editor.
  • Make your edits, and then once you’re finished, quit the editor with ⌘Q (don’t worry; as explained below, your text is safe).

QuickCursorKM then passes the edited text back to the source application and that’s all there is to it!

If for some reason the macro fails, your work has been safely saved from the beginning in one of two locations: ~/.quickcursor_km.txt or (less likely) in the Trash can with the date appended to the filename. You should also receive an error message that can be useful in debugging.

Supported text editors

I primarily use this QuickCursor replacement with MacVim. Here’s a list of all supported QuickCursorKM editors:

Adding New Text Editors

If the text editor of your choice isn’t listed, it’s easy to add because of the modular nature of QuickCursorKM.

To add your editor, simply duplicate any of the editor-specific macros and replace the path and the bundle-id variables with the analogous text for your app. If you don’t know the bundle-id of your editor, you may leave the variable blank: QuickCursorKM should still be able to locate the app based on the path given. Alternatively, I’ve built a helper macro that can determine the bundle id for you.

Once you have added your editor, be sure to submit a pull request so that others may use it as well!

Installation

All that’s required for installation is to download quickcursor-km.kmmacros on the releases page. Then open the file by double-clicking it.

Final Words

For users of Keyboard Maestro, QuickCursorKM is an excellent QuickCursor alternative. I hope you enjoy using it!

As always, if you come across any bugs or have suggestions, feel free to open an issue. The latest release of QuickCursorKM can be found on the releases page.

  1. From the beginning of the list, that’s ctrl-v, }, (, I, -,

  2. I make many of my macros sets in this manner and have found it useful in terms of managing those macros.

  3. I recommend using the same shortcut for all of them, as I have done. In doing so you will get a useful palette from Keyboard Maestro.

  4. The EditAnywhere macro will open the text in the system default editor for txt files.