17 AppleScripts You Should Try
Posted 10/21/2008 at 3:03am
| by Greg Healy
Just about every Mac user has heard of AppleScript—Apple’s scripting language, built in to your Mac’s OS, that allows you to automate tasks on your computer using an English-based language. But knowing of it and knowing what to do with it can separate the casual Mac-head from the uberelite power user.
AppleScript is a powerful tool on its own, but when coupled with an application like Quicksilver (free, www.blacktree.com) or QuicKeys ($79.95, www.startly.com), which let you assign keyboard shortcuts to AppleScripts, you can really boost the usefulness of these scripts.
To get you started, we present this list of 17 useful AppleScripts you already have on your Mac—they’re in your Library/Scripts folder, with a handy alias found in Applications/AppleScript/Example Scripts. To run one, just double-click it, which launches the Script Editor. There you’ll see a description of what the script does, as well as the script itself—to run it, just click Run. Then we’ll show you how to roll your own AppleScript and save it to the Scripts menu.
What You Need:
>> AppleScript Utility (Applications/AppleScript)
>> Script Editor (Applications/AppleScript)
>> Some sample AppleScripts (Library/Scripts)
>> Quicksilver (optional, to set up keyboard shortcuts, free, www.blacktree.com)
>> QuicKeys (optional, to set up keyboard shortcuts, $79.95, www.startly.com)
Finder-related Scripts

The script called Add To Folder Names lets you add a prefix or suffix to a whole slew of folders at once.
1. Add To Folder Names
These first few scripts are handy for when working in the Finder—and what do you know, they’re located in Library/Scripts/Finder. Add To Folder Names lets you add a prefix or suffix to all folders that are in the frontmost Finder window. If no Finder windows are open, the script will use items on the Desktop. If you’ve ever had to go through a large group of folders one by one just to add something to the folder name, you know how much of a time-saver this script can be.

Add To File Names lets you slap a prefix or a suffix onto every file in a Finder window.
2. Add To File Names
Add To File Names is the same in every way as Add To Folder Names except that it modifies files in the front Finder window, instead of folders.

We want to trim the word Fundy off the beginning of each of these folders. The script saves a ton of time.
3. Trim Folder Names
These next two scripts are the opposite of the two we’ve mentioned so far. Trim Folder Names lets you specify text that you want trimmed from the front or the end of a folder. This can be helpful when cleaning up generically named folders that you want to shorten.

Digital cameras' auto-generated filenames sometimes need to be shortened—Trim Files Names does just that.
4. Trim File Names
This script is the same as Trim Folder Names, though you might use it more often. Many cameras spit out files with generic names (DSC_1009 for example) that you can easily clean up with this script. Use it is conjunction with Add To File Names, and you could quickly change a whole folder full of images with names like “DSC_1009” to “Soccer09.”
Next up... More Finder scripts