Keyboard Maestro
Conduct your Mac Like a Pro!
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.
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).
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.
You can use the Time trigger to execute a macro when you login or 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.
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 that you otherwise might forget the Hot Key of.
You could use a trigger like this to add an action palette to an application that does not have such a facility.
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 and macro to be executed with a Public Web trigger.