Keyboard Maestro IconKeyboard Maestro

Conduct your Mac Like a Pro!

Macro Triggers

Overview

A Macro is executed when any of its Macro Triggers is activated. There are several triggers to choose from (detailed below), the most common being a Hot key, that is a Macro is executed in response to a keystroke, usually in conjunction with one or more modifier keys. You can also create a floating palette of macros, execute macros in response to applications launching or quitting, or continuously while they are running, execute them remotely via an in-built web server, or at a particular time of day, as well as other possible events.

Hot Keys

The most common Macro Trigger is the traditional Hot Key. You execute a Macro by pressing a key combination - a keyboard key like a letter, number, symbol or function key, often in combination with one or more modifiers (shift, control, option and/or command). Almost any key can be a trigger, and keep in mind the number pad counts as different keys to the numeric keys on the main keyboard. Normally the Macro will not repeat if you hold the key down, but you can enable Key Repeat to have the macro execute continuously while you hold they key combination down.

A common use for Hot Key triggers is to open applications or documents, insert text templates, or as a way of remapping command keys (for instance you can make command-T execute “Replace and Find Again” in an application that uses a different command key (or no command key) for that menu command).

Application

You can have a Macro execute in response to an application event, such as when the specified application launches, quits, activates or deactivates. You can also have the Macro run periodically while an application is running or while it is at the front.

You could use a trigger like this to simulate workspaces by automatically setting up an application the way you want when you launch it, or you could clean up after an application when you quit.

As with all triggers, the trigger will fire only if the Macro Group that contains it is active, which is based on the current foreground application before the specified application launches, or after the specified application is deactivated or quits. In practice, this means the Macro Groups that contain this trigger should be targeted at All Applications.

Login

You can use the Login trigger to execute a macro when you login. You can also execute a macro periodically (for example every ten minutes or every three days). Login triggers can also be restricted to certain days of the week.

You could use a trigger like this to set up your Mac environment when you start your Mac or run periodic maintenance or backup scrips.

Macro Palette

You can have a macro execute when you click on it in a floating Macro Palette. Keyboard Maestro will only display the palette when there are active Macros, so if your Macros are restricted to particular applications, then the Macro Palette will only appear in those applications. This is particularly useful for less frequently used macros whose Hot Key you might forget.

You could use a trigger like this to add an action palette to an application that does not have such a facility.

Public Web

Keyboard Maestro 3 has an inbuilt web server. You can enable it in the Preferences window pane. If enabled, and if you configure a username and password, you can connect to your Keyboard Maestro’s web server and login and then execute any macro you have defined. Also, if the web server is enabled, and if you have configured any Macro with a Public Web trigger, then anyone on the Internet can connect to your Mac and trigger Public Web macros.

Macros are only available if they are currently active (ie, they must not be disabled or in a Macro Group that is disabled, and their Macro Group must be currently active which depends on the current application).

For example, if you are running some sort of process on your Mac that occasionally fails, you could write a script to restart it and make it available as a Public Web triggered Macro, which you (or anyone else) could then execute to restart the process.

Clearly there are some serious security issues with this, so you should use a lot of caution when you allow any macro to be executed with a Public Web trigger.

Status Menu

You can have a macro execute when you select it from the Keyboard Maestro Status Menu (on the right hand side of the menu bar). Keyboard Maestro will only display the Status Menu triggered macros that are active, so if your Macros are restricted to particular applications, then they will only appear in those applications. This is particularly useful for less frequently used macros whose Hot Key you might forget.

You could use a trigger like this to add custom facilities to applications, such as to open specific common files or set up windows in specific ways.

Time

You can use the Time trigger to execute a macro at a specific time. You can also execute a macro periodically (for example every ten minutes or every three days). Time triggers can also be restricted to certain days of the week.

You could use a trigger like this to set up your Mac environment before arriving at work, run periodic maintenance or backup scrips late on the weekend, or launch iChat for your weekly video conference.

Wake

You can use the Wake trigger to execute a macro when your Mac wakes from sleep.

You could use a trigger like this to set up your Mac environment, first determining your location and then taking appropriate action.

Continue on to Recording

Close

Feedback Form

Please provide any feedback you may have


Email Address:
Subject:
Feedback:


Your email address is appreciated but is not required and will not be saved.
It will be used only for responding to or clarifying this feedback.

Documentation

Keyboard Maestro

Old Documentation

Search