To remote control an application, AppleScript is the best way most of the time. However, sometimes it is much easier to simply send a keystroke to an application.
For example you may select the next album in iTunes which is very diffcult to be performed using AppleScript. But using an keystroke it is as easy as pressing Option-Right. You have to activate iTunes before, of course.
To create a keystroke action, please choose Add Keystroke from menu Actions. The inspector will show the freshly created action as part of the AppleScript section of the Action Archive.
This is the "edit part" of a keystroke action:
The text fields Group, Title and AppleScript Name are known from the other action types.
Please enter the name of the application which is to be activated - in this case iTunes. If you leave this field empty, the currently active application will get the keystroke - this is very convenient for system-wide shortcuts like Exposé keys.
To specify the key to be send, click into Char(s) or Special Key, then press the desired key. Only one special key like cursor keys are allowed, however, you may enter more than one "normal" characters in the field above.
To enter a function key, the popup is for your convenience. Else, pressing the F12 for example would enable Dashboard immediately.
Select a modifier key from the rightmost section if appropriate.
Sometimes it is required to wait a small amount of time, before an activated application will react on the sent keystroke. Try out different wait times from the respective popup menu, then.
Keystroke actions will be placed in the AppleScript section of the Action Archive, because they are based on AppleScript. That's the reason why errors in spelling the application name, e.g., will lead to AppleScript errors.
To distinguish Keystroke Actions from AppleScripts they've got their own icon:
.
![]() |
Last Update: April 27, 2006 |