Mac Hacks: 17 AppleScripts To Make Your Life Easier

AppleScript is a scripting language developed by Apple to help people automate their work processes on the Mac operating system. It accomplishes this by exposing every element of the system’s applications as an object in an extremely simple, English-like language. AppleScript is to the Mac OS as JavaScript is to browsers.

Quite a few AppleScripts are available on the Web, ready for you to use, so you don’t even need to look at their code. This article presents you with 17 of the most useful ones.

If you’re interested in learning this language, here are some good resources to get started:

First, Where To Put Your AppleScripts

After you download a script, you have to know where to put it to start using it. For this purpose, let’s say that there are three different kinds of AppleScripts, each of which is used for a different purpose.

Simple Scripts

You put these scripts in a special folder and call them when you need them. You can invoke them just by double clicking on them, but calling them contextually is a lot more effective. Using the Script Menu is one way to achieve this.

To activate the Script Menu, first open the AppleScript Utility app in the /Applications/AppleScript folder and check “Show Script Menu in menu bar.”

AppleScript Utility screenshot

The Script Menu will show a list of AppleScripts that come with Mac OS X, plus your application-specific scripts. To add a script to an application, simply put it in ~/Library/Scripts/Applications/<NAME_OF_THE_APPLICATION>. If that folder doesn’t exist, you can create it.

For example, if you had a Safari AppleScript, you’d put it in ~/Library/Scripts/Applications/Safari. From then on, if you clicked the Script Menu when Safari was active, your script would appear at the top of the list for you to use.

Simple Script screenshot

Droplets

Droplets are AppleScripts that live in the Finder’s toolbar. To use it, all you need to do is drop a file or folder into it. This is very useful for when a script affects a file or the contents of a folder, because all you have to do is drop the target of the action onto the script’s icon.

To “install” a Droplet, first save it in a folder of your choosing: ~/Library/Scripts/Droplets is a good place. Then just drag the script to the Finder’s toolbar.

Droplet Screenshot

Folder Actions

Folder Actions are AppleScripts that are “attached” to a folder. They are executed every time you perform an action with that folder. Folder Actions can get triggered every time you add a file to a folder, remove a file, modify its items, etc. The behavior depends on how the script works, but you can imagine how useful that would be.

To add a Folder Action to a folder, right-click it to bring up the contextual menu, and click Attach a Folder Action. The default location for Folder Action scripts is /Library/Scripts/Folder Action Scripts, but if you want to keep all your custom-installed scripts in one place, ~/Library/Scripts/Folder Actions is a good place to keep them.

Folder Action Screenshot

-->