Wednesday, February 27, 2013

Assign A Keyboard Shortcut To An AppleScript

FastScripts, by Red Sweater Software is how I assign keyboard shortcuts to my scripts. It works just like the standard Script Menu, except it has many improvements. Fast scripts will allow you to assign keyboard shortcuts to your scripts and this works amazingly well! I've assigned keyboard shortcuts to some of my Illustrator scripts and it feels as though they are a native part of the program. It's a much more seamless experience than having to navigate the standard Script Menu.

It also provides dialog box messages when your script errors, which is much more useful than the silent treatment that I get from the regular Script menu. It's free to download and it never expires. The only limitation of the free version is that it's limited to 10 keyboard shortcuts, which I feel is generous. The unlimited version is currently $14.95 $9.95 (a $5 reduction since I first wrote this. Updated 10-10-15).


Installing FastScripts

Download FastScripts, move it to your applications folder and then double click on it to launch it. There are a few screens of information to read through. It will ask you if you want to add it to your login in items so that it will automatically open when the computer starts up. I suggest that you do so– if you change your mind this can easily be turned off in the FastScript Preferences. The preferences can be found in the FastScript menu itself. Click on it, then click on "FastScripts" and then select "Preferences". To turn off the automatic launching on startup, click on the "Script Menu" tab at the top of the preferences panel and then uncheck the box that states "Start FastScripts whenever I log in to my computer".

Assign Keyboard Shortcuts to run a script

In the same Preferences panel as described above, click on the "Script Shortcuts" tab at the top. Your scripts will be listed there, but you may have to click on the disclosure triangles to navigate through the folders to reveal the scripts within them. The column on the right named "Shortcut" is where you assign a shortcut to a script by double clicking on where it states "(none)" and then pressing the key command that you want to use.

If it doesn't want to take a particular keyboard shortcut it may be that shortcut is already in use and you will have to try a different one. I also recommend getting familiar with the default shortcuts so that you don't try to assign a script to it. I once tried to assign command F5 to a script without realizing that this is the command to turn on the Voiceover feature.

The default keyboard shortcuts for Mac OS X can be turned off or assigned to different functions in the System Preferences. Click on the "Keyboard" preferences, and then click on the "Keyboard Shortcuts" tab on the right. The column on the left are the apps, and the column on the right lists the shortcuts for each app. You can turn them on or off, and there is a "Restore Defaults" button if you happen to go too far with it.

Screenshot of the keyboard preferences
The Keyboard system preference where you can change the
default keyboard shortcuts for Mac OS X
 *Login items can also be managed in the System Preferences in Mac OSX. Click on the apple icon and select System Preferences. Then click on Accounts. Click on the name of your account in the column on the left. On the right you will notice two tabs at the top. Select "Login Items". This is where you can check or uncheck which items will open when you log in. If the application you want to open on startup isn't show, click on the + button and navigate to the application. 

No comments:

Post a Comment