Stairways Software Icon

Stairways Software

Excellence In Software For Over Ten Years – Only with a Mac

Executing Macros from AppleScript and Other Scripting Languages

Keyboard Maestro macros and actions can be executed via AppleEvents which means you can do anything Keyboard Maestro can do from most scripting languages, including AppleScript, perl, python, etc.

To make this even easier, in Keyboard Maestro 3.2, we added a Script pseudo-trigger. When you select it from the New triggers popup menu, it doesn't actually add a trigger, instead it shows you how to trigger the macro from various scripting languages, for example, for AppleScript, it might look like:

tell application "Keyboard Maestro Engine"
 do script "B39812D2-DDA0-4309-BBA5-C9902FA5B164"
 -- or: do script "Paste Plain Text"
end tell

So your AppleScript (or perl script, or whatever) can now easily perform any macro that you can create in Keyboard Maestro.

It is also possible to execute any action, but that is a little more tricky as you have to send the XML for the action. Still, it is useful if you want to create actions on the fly. See the documentation (or email me) for more details if you are interested in this level of control.

Posted Thursday, July 3, 2008. Permalink. Post a Comment.


Post Comment

Name: (optional)
URL: (optional)
Email: (optional, not published)
CAPTCHA: three six one five (required)
  To prove you are human, please enter the number as digits (ie, 1-9).
  You can use some HTML tags such as <b>, <i>, and <a href="">.
We reserve the right to remove any offensive or inappropriate comments.
Due to spam issues, comments are initially invisible until we review them,
you can see them (background red) and we can see them, but no one else.

Comment Preview

None yet.

Buy Now

User Database