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.
Additional Folder Action Resources
- Automator: Folder Actions explains how to use Automator (built in macOS App) to create your own Folder Actions.
- A Folder Action script used to separate AirDropped files into a different folder other than the default Downloads folder.
- Folder Action Reference by Apple.
15 thoughts on “Folder Actions in macOS Explained with Practical Examples”
Can anyone explain WHEN they are triggered?
On my Win7 box, I periodically run a script to zip up a certain folder, and copy it to places on the Win Box.
One of those places is a shared folder, to which I have access from my Macbook.
That folder has an action attached, which MOVES it into a specific folder on the Mac, and runs Transmit, to send it to an FTP site.
When I don’t care, I can see the folder appear, and disappear, within a second. Then Transmit perks up and it’s all good.
But when I’m in a hurry, like waiting to shut down, I see the file appear and it can be 30- 60 seconds before the Mac sees it and runs the script.
Is it just polling every so often? Or what triggers the action, exactly?
Thanks for the explanation.. was really helpful.. I hope all explanation were this easy to understand .. specially when u struggling to decide if u shud upgrade your Power Book G4 from 10.4.11 to Leopard or get a new Mac Book rather .. love my G4 too much to let it go..
After struggling with folder actions for ages (never having them work) and trying everything, I finally got this example to work. Great Job!!! This has helped immensely, I can’t wait to start writing my own scripts now.
Fantastic! Many many thanks for sharing!
Thanks for this tutorial.
Great tip. I will definitely give this a go on my iMac.
Ok i give you thumbs up!
Please I would like to see someone tell me, how can I do so that when someone put a file in a folder anyone, I notice that this or that is activated if it is open.
Thanks in advanc
thank you very much. You gave an easy explanation.
Great tutorial, this will help me out big time with workflow on my mac.
Thanks for the great tip. Is there a way for the music or movie folders to search the computer and add music/videos automatically?
I wish all tutorials were this clear! Excellent tip!!!
Wonderful tip! I’ve been wondering what folder actions was about but never really had the time to figure it out. Thanks again!