Chapter 13. Folder Actions

THIS CHAPTER

  • What are Folder Actions?

  • Enabling Folder Actions

  • Folder Action Scripts

  • Creating your first Folder Action Script

  • Creating Folder Action plug-ins with Automator

In Chapter 12, you learned how to create applets and droplets, which brought your AppleScript abilities up to a whole new level. Instead of having to invoke and run your scripts via AppleScript Editor, you can now create scripts that can be invoked via simple actions: either by double-clicking a mouse or by dropping files onto the scripts.

In this chapter, you're going to learn about folder actions, another extremely useful tool that will make your automations a lot more sophisticated. Without further ado, let's get started!

What Are Folder Actions?

Put simply, Folder Actions are a feature that lets you associate AppleScripts with individual folders. Whatever you do to that folder (move, copy, add files, remove files, rename, whatever) can trigger the Folder Action Script that's been associated with that folder.

In other words, think of Folder Actions as giving you the ability to create hot folders that respond to actions. Imagine being able to create a folder on your desktop that automatically sends any file placed into it to the printer. Or adding an alert feature to your Public folder that lets you know when anyone on the local network adds a file to it. Or adding a workflow to a folder that archives any files that are dropped into it.

At the end of the day, Folder Actions are just one more ...

Get Apple® Automator with AppleScript® Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.