This guide will explain what Folder Actions for macOS are, how to set them up, and provide help for you to create your own Folder Actions.
What are Folder Actions for macOS?
In a nutshell, Folder Actions are scripts that can be attached to folders. They enable events to take place when items are added or removed from that folder, or when the folder is opened, closed or moved. A number of Folder Actions are included with macOS, but more importantly – you can build your own and even download Folder Actions created by others in the Apple community. Once you start using them you quickly realize how helpful and time-saving they can be.
Examples of Folder Actions
- When you put images in a certain folder, they’re automatically converted to JPG or PNG
- When you put files in a certain folder, they’re automatically uploaded to a web server
- When you close a Finder window, all the sub-folder windows close as well
- You’re notified when new files are placed in a certain folder
- When an image is placed in a folder macOS automatically sets that image as your Desktop wallpaper
- When new files are placed in a certain folder (like your Desktop or Download folder) they’re moved based on file type
How to enable and use Folder Actions
- For this example we’ll set up a Folder Action that automatically converts images to JPG format just by dropping them into a folder (this particular Folder Action is included with macOS). Start by creating a new folder. Now right-click (ctrl-click) on that new folder and select Folder Action Setup…
- When prompted, click the Run Service button.
- Now choose a script to attach to your folder. For this example we’ll go with Image – Duplicate as JPEG.scpt. Once you’ve selected it, click the Attach button.
- Make sure there’s a check in the box labelled Enable Folder Actions and then exit out of the Folder Actions Setup panel.
- That’s it. Now drag a non-jpg picture into that folder (a PNG, GIF etc).
- If you’re using macOS Catalina (10.15) or higher, you’ll be presented with a couple of access permission requests. Click OK on each of them.
- Ta-da! The Folder Action will have duplicated your image, but this time as a JPG. It will also save the original image.
- If you ever want to change or disable a Folder Action, right-click (ctrl-click) the folder and select Folder Actions Setup… again and either remove the check-mark next to the Folder Action you wish to disable or select the Folder Action and click the Edit Script button.