Hot key to expand Typinator snippet?

I'd like to have a text snippet populating when I press an hot key.

+ + M → #

Tried simply typing the keyboard shortcut in Typinator but it requires you to press each key independently rather than as an hotkey.

I am wondering if there's a way or a workaround with Keyboard Maestro.

This is a little unclear. Do you want ⌘⇧M to type "#" or do you want to press ⌘⇧M and then # in order to type a specific snippet?

For the former, it's as simple as triggering an Insert Text by Typing action with a hotkey.

Screenshot

For the latter... if you're trying to press a shortcut, then a key and have it type some text, I have a suggestion. You can't use the # symbol or any other that requires a modifier, but this will work for any letter or number key:

Typinator Snippet.kmmacros (30 KB)

Macro screenshot

Typinator Snippet - Watch for Keypress.kmmacros (26 KB)

Macro screenshot

Usage:

Trigger the Typinator Snippet with ⌘⇧M. If your next keypress is found in the Switch/Case group, it will insert its snippet. If not, you can carry on as though you never triggered the macro.

The Typinator Snippet - Watch for Keypress macro simply captures the keypress to a variable to be used by the main macro.

Thanks a lot!

Sorry for the confusion. I'd like + + M to type #

I am perfectly aware of the possibility of assigning a hot key to a "Insert text by typing" action. Although I'd like to pass through Typinator because I already use a macro which activates Typinator sets only when the target application dialog window activates.

Expand here for development process of that macro.

AppleScript to enable Typinator when Todoist "Quick Entry" activates?

So I am wondering if there's a native way in Typinator, rather passing through Keyboard Maestro?

In the meantime, I'll play around with the examples you've just posted and see if any of those helps.

I'm afraid I won't be much help with Typinator as I don't have it.

Are you saying you don't want to run a KM macro because another KM macro is already running? Have you tried to see if there's actually any conflict?

Hey there Alex, from what I have researched there is no way to assign a Keyboard Maestro style "hotkey" to Typinator rules. I imagine the reason being that Typinator is (as the name implies) an application designed to perform actions while typing. :wink:

That being said, you can expand any Typinator expansion via AppleScript which of course can be run from Keyboard Maestro (and Typinator too can run AppleScript but I have dabbled very little with this feature).

Sample AppleScript to be ran from Keyboard Maestro (click to expand/collapse)
tell application "Typinator"
	expand string "PLACE THE EXPANSION'S ABBREVIATION HERE"
end tell

For example, I use the following AppleScript run from KM:

My AppleScript to expand a Typinator expansion for Script Debugger (click to expand/collapse)
tell application "Typinator"
	expand string "sd:varinstset"
end tell

to trigger this expansion in Typinator:

Screenshot of Typinator expansion (click to expand/collapse)

Click here to see what that Typinator rule actually does if you're interested. (click to expand/collapse)

First, Typinator opens a dialog window asking me for the KM variable and what I would like to designate as the AppleScript variable.
Then it inserts that text into Script Debugger and simulates the ⌘K key to compile the new script.
See the screenshot and script to see the results.

### Requires Keyboard Maestro 8.0.3+ ###
set kmInst to system attribute "KMINSTANCE"
tell application "Keyboard Maestro Engine"
	setvariable "local__xPos" instance kmInst to xPos
end tell

So whatever your existing Typinator rule is to insert the hashtag, you can take it's abbreviation as defined in your Typinator set and replace the PLACE THE EXPANSION'S ABBREVIATION HERE bit in my sample AppleScript above, make a new KM macro with just a single action being that AppleScript, assign it whatever hotkey you want and voila, Typinator will insert the hashtag for you.

If that's not quite what you're looking to do, let me know and i'll see if I can help you some more.

-Chris

1 Like