![]() Note that it would be useless to try to match a word break at the end with \b or some sort of positive or negative lookahead assertion as the typing sequence always ends at the current character. The trigger is matched against the end of the typing sequence, so there is an implicit \z on the end of the regular expression. You can limit the typed string trigger to only work after a word break (which means any non-alphanumeric character, or any case that cancels the sequence as described above).Īlternatively, you can use a regular expression to match a trigger. You can optionally allow typed string triggers to work regardless of case, regardless of diacriticals, or to remember the case of the typed string and mimic the case in any Insert Text actions. ![]() If you need to type the trigger text without the macro firing, type and delete a Shift-Space in the middle, like "=e«Shift-Space»«delete»m=".Īs above, typing Shift-Space will cancel the sequence, as will any control key or command key (eg Command-.), any macro execution, switching applications, clicking the mouse, or not typing for more than a few seconds. Keyboard Maestro will accept the trigger even if you use the delete key to correct it (for example, in the case above, if you typed "=en«delete»m=" the trigger will still fire. For example, to insert your email address, rather than use just “em” (which would fire if you typed “them”), use something like “=em=” which you will not type accidentally. To avoid macros firing unexpectedly it is a good idea to include a consistent prefix and/or suffix to your strings. WARNING: You should generally not use a Typed String trigger that simulates deletes in a non-text typing context, as the simulated delete keystrokes could be destructive. Triggers can include non-ASCII characters, but you should verify that the deletes work appropriately in these cases. Because the keys first go through to the current application, the keys are usually deleted prior to executing the macro, although with this disabled you can use it in an application that largely ignores keys. Typed String triggers allow you to use more verbose (and hence descriptive) sequences of keys to trigger a macro. The Typed String trigger lets you execute a macro in response to a sequence of keys. You could use this feature to allow a single hot key to do multiple user-selected actions. You can select a macro from the palette using either number keys, or by typing the first distinct character to filter the macros down until only one is left. To further help with this, if multiple macros are executed with the same hot key, the conflicting macros are displayed in a palette allowing you to select the desired macro. You can also use a tool like Ke圜ue to display command keys and macro hot keys. This can be mitigated by selecting consistent keystrokes (such as Control-Letter to mean insert text and Control-Option-Letter to mean launch an application). Hot Keys suffer from the drawback that you need to remember a cryptic keystroke. This allows you to do things like have a macro execute when the key is pressed, and then a second macro execute when the key is released, for example to toggle a setting on and then off again.Ī common use for Hot Key triggers is to open applications or documents, insert text templates, or to remap command keys (although you can also remap command keys in the System Preferences Keyboard preference settings). The macro can execute when the hot key is pressed, released or repeat continuously while it is held down. ![]() ![]() Note that there is a relatively prevalent third party / system bug that makes the system think it is permanently in a password filed, and this will prevent entering a hot key by typing in this manner. You can type the desired key or key combination in the hot key box, or select a predefined key (holding down any desired modifiers) from the popup menu to its right. 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. You execute a Macro by pressing 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). The most common Macro Trigger is the traditional Hot Key. You can also trigger macros by name using the Trigger Macros by Name action, which in turn can be in a macro and triggered any way you desire. Or you can display the containing Macro Group as a floating palette, or execute macros remotely via the built-in web server. You can also trigger a macro by typing a string. 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. A Macro is executed when any of its Macro Triggers is activated. ![]()
0 Comments
Leave a Reply. |