AppleScript Guide: Mastering Folder Actions, Part I

Welcome to the first installment of our series on AppleScript and its application in automating folder actions. In the upcoming posts, we’ll delve deeper into this topic. For now, let’s explore the basics of folder actions. Imagine the convenience of dropping a file into a folder and having it automatically print, upload via FTP, or even rotate an image. This is possible on Mac OS X with the native folder actions feature, which simplifies these tasks to a mere drag and drop operation.

Creating the folder
Let’s begin by setting up a special folder on your desktop that notifies you when a file is added to it. Start by creating a standard folder on your desktop; this can be done by right-clicking and choosing “New Folder,” or through the “New Folder” option in the Finder’s File menu.

Once you’ve named your new folder, right-click on it and choose More > Enable Folder Actions.

Right-click again and select More > Configure Folder Actions. This action opens the Folder Actions Setup.app, an AppleScript utility. Here, you can add the desired actions to your folder. On the left side of the window, you’ll find buttons to add or remove folders from the list. Click the plus (+) button and select the folder you just created on your desktop.

A dropdown menu will appear, prompting you to choose an Apple-provided script. Select “add – new item alert.scpt,” which will trigger a notification whenever something is added to the folder.

You’ll see this script appear on the right side of the window. You can add multiple scripts to a folder, and they will execute sequentially. After setting this up, you can close the window.

It’s just a drag to the left…. activating the scripts

Now that your folder is configured to accept files via drag and drop, try moving a file into it. Depending on the file size, a dialog box should appear shortly, informing you that your file has been successfully added. It’s a simple yet effective tool to streamline your workflow.

I often use this folder action for my Drop Box in the public directory of my user account.

Avatar photo

Ronald is a dedicated writer for TUAW, bringing a wealth of knowledge and enthusiasm for all things Apple. With a keen eye for detail, Ronald covers the latest news and updates on products like the iPhone, iPad, MacBook, and Apple Watch. His insightful articles help readers stay informed about the ever-evolving world of Apple technology. When he’s not writing, Ronald enjoys exploring new apps and discovering innovative ways to use his Apple devices.