Keyboard Maestro Triggers and Actions
Mac Tip #450, 18 August 2010
Keyboard Maestro can work your Mac for you, but you need to tell it what to do and when to do it. This Tip explains Triggers, Options within Actions and how to Record a Macro.
Use the coupon
MacTips for a 20% discount on Keyboard Maestro. [Updated] This offer expires at the end of October 2010. It’s free to test the software.
Previous Tips showed how to set up some macros for Keyboard Maestro to work with, but a big consideration is how to trigger a macro. There are triggers like typing something, clicking a button, choosing a menu item, or even setting things to happen at a certain time.
Here are some details about a few specific triggers. There are full details about all the Triggers on the Keyboard Maestro website.
Hot Key and Typed String
A Hot Key may be something like pressing
F8. You choose which key it will be and whether the trigger is simply held down or pressed or released.
How to choose the Hot Key and its options:
- Click the green
+beside a trigger and choose
Hot Key Triggerfrom the menu that appears. Hot Key options appear below the words
This hot key:.
- Click the arrow (▾) beside the field highlighted in blue and labelled
Type. Many keys, such as
Clearare listed. Choose the key you want to use. Its name replaces the word
- Click on the
is pressedoption to the right of the key selection box. A menu appears with choices:
is down, and
is released. Choose the state that suits your project.
Now when you press, release or hold down the selected key the macro will leap into action.
A Typed String is where you may type something like
teh. A possible Action is to automatically replace what’s typed by a correction. I explained that in the first Tip. Of course, you can choose any actions you like — perhaps opening a program, runing a script or something else.
A Time Trigger activates at a selected time on selected days. My screenshot shows a Time Trigger that will activate at 08:30 on Mondays, Wednesdays and Fridays.
Select either the hour or minutes, then use the arrows beside the time field to increase or decrease the hours or minutes by 1. Or just type a new time.
When you create a new Time Trigger, all the days are selected. Click on any day to toggle the selection.
Status Menu Trigger
The Status Menu appears in the Menu Bar. If you choose this as a Trigger the name of the macro will appear under the Keyboard Maestro Menu Bar icon.
The Status menu always appears, if you choose that Option in Preferences, whether there are any available macros or not.
The screenshot shows my Status Menu open, with about a dozen macros available.
Macro Palette Trigger
The Macro Palette Trigger is a bit tricky.
It appears in my screenshot as a dark grey button ‘floating’ on screen, and displaying the Keyboard Maestro icon. If I hover over it, it opens up to list available macros.
The thing is, that if you don’t have any active macros that use it, then it doesn’t appear at all. Nor does it appear if you close it by clicking the grey
x in the top left corner.
To be able to use the Macro Palette choose it as a Trigger for an Action. Then when you hover over the Macro Palette it expands so you can click an item. It collapses again when you move the mouse away.
To relocate the Macro Palette on screen hover over it to expand it, then drag by the Title Bar.
Options within Actions
Most Actions provide options for how they will work. For example, the
Manipulate a Window action could resize a specific window by a percentage or a number of pixels, move the window to a specific location, close it or do various other things.
These options are slightly hidden. On any Action, look for the disclosure arrow (▹) beside the Action and click it to reveal more options. Also look for a double-headed arrow beside any text as it shows you can click an item to bring up a menu of options.
Record a Macro
You may wish to click somewhere on screen or resize a window to certain dimensions as part of an Action.
There’s no need to guess at the co-ordinates for such activities: instead Record a Macro. Keyboard Maestro will record everything you do, including extra clicks and actions.
After recording you can delete the extra stuff, or just pick out the smaller actions you wanted to do and use them in another Macro.
To Record a Macro make a new Action, then click the
Record button at the bottom of the window. A red ‘alert’ appears under the Actions list in the Macro and a red ‘Recording’ button appears on screen.
Now click on windows, move things, open applications and so on. Keyboard Maestro records everything you do.
When you’re finished recording click on the red Recording button to stop recording.
Now sift through the recorded Actions to locate those you need. This is a great way to discover the co-ordinates for clicking the mouse as part of a larger action.
Triggers and Actions lie at the core of Keyboard Maestro. Just remember to look a little below the surface to access its full power.
Use the coupon
MacTips for a 20% discount on Keyboard Maestro. [Updated] This offer expires at the end of October 2010.
Have you used Keyboard Maestro yet? Tell us about your experiences in the Comments. Have you found any great Tips? Share them with us.