A macro utility can be used to automate repetitive or boring tasks. Each macro contains a sequence of instructions, such as copying, pasting, editing, choosing menus or responding to dialogues.
To store your instructions you must first switch your macro utility into record mode and then perform each step of the macro manually. Alternatively, your utility may let you create or edit a macro by means of a scripting language. Your completed macro can be replayed at any time and can be assigned a key combination that can be used to activate it.
The most well-known macro application is AppleScript, a powerful system built into modern versions of the Mac OS. It has a recording feature, although this doesn’t work in all applications, and is slow on older Macs and with systems prior to Mac OS 8.5.1. Mastering the AppleScript language isn’t easy, but having done so you can create scripts for a wide range of operations.
Simpler alternatives to AppleScript include QuicKeys, for both Mac OS X and the Classic Mac OS, and KeyQuencer for the Classic Mac OS. The latter, although daunting to the uninitiated, is quite simple and uses an small amount of memory. It also works with OtherMenu, allowing you to navigate around your folders, even when inside an older form of Open or Save dialogue.
Not all macro editors let you use application-specific key combinations. For example, most KeyQuencer commands are global, meaning that they do the same thing in all applications. Depending on what you want to do, this can be an advantage. However, if you want to use the same keys in various applications you may prefer to use QuicKeys.
Some Macs don’t include all the keys provided on a full-size keyboard. Most significant of these are the Home, End and function or F keys. You can add these features to a small keyboard by using a macro to generate a new key code whenever you press a chosen key combination.
Here are some possibilities:-
|Required Key||Key Combination|
Try to avoid combinations already used in applications, as your macro may not be able to override such shortcuts. You may be able to find a system extension that adds a Forward Delete key function independently of a macro. When installed, your keys should then work as follows:-
|Delete ||Backward |
|Option-Shift-Delete ||Forward |
* Standard Delete key operation
• Provided by Option-Forward Delete on an extended keyboard
Each character that appears when you type a key is set by resources contained in the System file. Rather than modify these resources, you can use a macro to generate a substitute key code for each key, a process sometimes known as keyboard remapping.
For example, suppose you want
( to appear when you press the [ key, which can be represented as:-
Firstly, you’ll need a macro to generate the
( character. With KeyQuencer this consists of:-
Then you assign this macro to the [ key. It’s as simple as that.
Other keys can be changed as required. For example, if your word processor doesn’t support smart quotes you could try the following remapping:-
[ –––＞ “
] –––＞ ”
Macros can also be used to manipulate text strings. For example, if you want to extract the month from a date such as:-
you could use a macro to generate these keys in sequence:-
leaving you with the cursor correctly positioned at the end of the text containing
Macros can also be used to twiddle letters, a process that reverses adjacent characters. You can use this to correct typing errors in a word such as
head, which can end up as
haed. The macro should generate these keys in sequence:-
which of course assumes that the cursor was initially positioned after the pair of letters.
In text documents you may need to change straight quotes into smart quotes. You can do this as a two stage process by means of a text editor controlled by a macro:-
Replace ＜space＞" by “
Replace " by ”
＜space＞ represents an actual space. Note, however that this doesn’t work properly for quote marks that appear at the beginning of a document or at the beginning of a paragraph.
Having chosen a macro utility you’ll need to choose the key combinations for each task. Many people use the function or F keys for these jobs. Unfortunately, older PowerBook computers and other keyboards don’t have these keys, although you can use the Ctrl key in combination with other keys. Fortunately, applications rarely use Ctrl, except for contextual menus. If in doubt, check your applications to see if any spare key combinations are available.
Sometimes it’s difficult to remember which key does what without sticking labels all over your keyboard. To help you memorise the keys you can use a hierarchy of key combinations, as shown in the arrangements below, which are designed for the Classic Mac OS. The first set lets you select commonly-used applications or control panels:-
|Keys ||Application or |
|Ctrl-V||Virus Checker (Virex)|
Always try to use a letter that relates to the application’s function rather than its name. If you change the application later you won’t need to change the shortcut.
The next set give you access to your Documents folder and folders inside it:-
whilst the following let you open specific folders in your Applications (Mac OS 9) folder:-
|Keys ||Folder in |
|Ctrl-Shift-V||File Viewing Software|
To remember these, note that the Shift key is just below the A key, and that A stands for Applications.
The last set of combinations give you access to your System Folder and folders inside it:-
|Keys Pressed||Folder in |
|Ctrl-Shift-Option-A||Apple Menu |
With a suitable macro utility you can create a set of special instructions that give you really powerful control over your Mac. The examples shown below work with KeyQuencer. You can of course select your own preferred key combinations.
|Keys Pressed||Special |
|⌘-Ctrl-Option-A||Show About Mac |
|⌘-Ctrl-Option-B||Balloon Help |
|⌘-Ctrl-Option-Q||Quit all |
|⌘-Ctrl-Option-T||Show contents |
Finally, you can use special combinations for opening selected files using alternative applications. For example you may want to open a selected document in ResEdit instead of its normal application or a GIF graphic file in GraphicConverter instead of Internet Explorer. Here are some examples:-
|Keys Pressed||Open Using:-|
|⌘-Shift-T||Text Editor (BBEdit)|
Once again, use a letter that relates to an application’s function rather than its name. Ideally, these should be the same letters as used in the macros that open the applications.
A text macro utility, such as TypeIt4Me (Riccardo Ettore), automatically replaces typed text by an alternative string of characters that are kept in a special file. This is particularly useful if you hate typing long words. Here are some examples:-
|*dl||Tuesday, July 16, |
You could even enter
*addr to produce your entire address, including the necessary carriage returns.
The replacement text isn’t inserted until you type a trigger character, usually a space or the other punctuation normally used at the end of a word. This prevents the expanded text from appearing in the middle of words.
©Ray White 2004.