Hacker News new | ask | show | jobs
by jaymzcampbell 3732 days ago
Just to chip in as another very happy user of Keyboard Maestro here - I have been using it for text expansion as well as more general macros and it has made switching to a Mac full time a pleasure. Combined with Alfred it takes 'power user' to another level.

I use it for as much friviolous stuff as serious things (http://i.imgur.com/YgE82eP.png) - having never used TextExpander, I've not had any problems with the text replacements. It's possible to open dialogs and very quickly make UIs too for more involved stuff.

1 comments

Does Keyboard Maestro support text fields where it prompts you for input before sending the completion? For instance, TextExpander and aText let you write something like:

  :foo expands to
  
  Dear [name], thank you for buying our stuff. We like you, [name]!
Then, when you type ":foo", it prompts you for "name" and fills out the template with "name" inserted everywhere it's mentioned. This is enormously useful for form letter types of things, or even more esoteric uses like expanding HTML tags ("<[tag]>[content]</[tag]>").
There are a number of ways to do this. Native to Keyboard Maestro are:

Prompt For User Input [1] is the easiest method and allows you to build a form fully within the KM's GUI.

Custom HTML Prompt [2] lets you make a full HTML/CSS/JS form. I have never had need of this, but in principle you can leverage any web browser tools such as jQuery and Bootstrap to make a complex form.

Check out the KM forums for examples. KM also allows you to fully integrate AppleScript and shell scripts, so you could do all sorts of other crazy workflows.

[1] https://wiki.keyboardmaestro.com/action/Prompt_for_User_Inpu...

[2] https://wiki.keyboardmaestro.com/action/Custom_HTML_Prompt

Thanks to you (and everyone else) for the clarification. That's my single biggest need from a TextExpander replacement.
It's not as straightforward as TextExpander or aText, but it's possible to do so in Keyboard Maestro.

The macro: http://imgur.com/1oIhtJm.png

The prompt: https://imgur.com/esJt4gM.png

Keyboard Maestro macros consist of a trigger and an action. In the above example, I used the Typed String trigger to detect when "hhi" is typed then execute an action to create a prompt and paste the text with content from that prompt.

You can use prompts in the macro, save it to a variable and use the variable in the text it pastes/types.