Folder Actions for OS X explained – with real-world examples

What are Folder Actions?

In a nutshell, Folder Actions are scripts that can be attached to folders. They enable events (actions) to take place when items are added or removed from that folder. Events can also occur when the folder is opened, closed or moved.

Real-World Examples

  • When you put images in a certain folder, they’re automatically converted to JPG
  • 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
  • When new files are placed in a certain folder, you’re notified
  • When new files are placed in a certain folder (like your Desktop or download folder) they’re moved based on file type
  • See more in the Folder Action Resources section
  • How to enable and use Folder Actions

    1. For this example we’ll create a Folder Action that converts images to JPG format just by dropping them into a folder (this particular Folder Action is included with OS X). Start by creating a new folder.
    2. Now right-click (ctrl-click) on that new folder and select Enable Folder Actions

    3. click to enlarge

    4. Again, right-click (ctrl-click) that same folder and this time select Attach a Folder Action…

    5. click to enlarge

    6. You’ll probably be presented with a list of scripts. If you’re not, you’ll need to navigate to the folder that contains all of the Folder Action scripts. They’re in Mac HD/Library/Scripts/Folder Action Scripts/. Select Image – Duplicate as JPEG and then click Choose

    7. click to enlarge

    8. That’s it. Now drag a non-jpg picture into that folder (a PNG, GIF etc).
    9. Ta-da! The Folder Action will have duplicated your image, but this time as a JPG. It will also save the original image.

    10. click to enlarge

    11. If you ever want to change or disable a Folder Action, right-click (ctrl-click) the folder and choose Configure Folder Actions…
    12. From here you’ll be able to manage all of your Folder Actions in one place.

    Folder Action Resources 

    Here are some sites that provide pretty cool Folder Action scripts etc –

  • Auto-sort files dropped into the System Folder (like OS 9)
  • Automatically add/import files to iTunes when they’re placed in a folder
  • Upload files using Cyberduck when they’re placed in a folder (Upload Sample.scpt) – read the readme.txt for more info
  • Use Folder Actions and Automator to keep your Desktop super-clean
  • Automatically import (and tag) Photo Booth photos into iPhoto
  • Writing Folder Action scripts
  • { 44 comments… add one }
    • JP January 31, 2007, 3:52 pm


    • Filip Lam January 31, 2007, 7:34 pm

      Wonderful tip! I’ve been wondering what folder actions was about but never really had the time to figure it out. Thanks again!

    • UT January 31, 2007, 11:29 pm

      I wish all tutorials were this clear! Excellent tip!!!

    • Nick January 31, 2007, 11:42 pm

      JP, Filip and UT –

      Glad to hear it helped!!

    • Hani February 16, 2007, 7:35 am

      Thanks for the great tip. Is there a way for the music or movie folders to search the computer and add music/videos automatically?

    • Andy October 6, 2007, 5:38 pm

      Great tutorial, this will help me out big time with workflow on my mac.

    • Murphy November 13, 2007, 9:24 pm

      Good info, thanks.

      Here’s how to make a folder that mails files added to it to a preset address, useful for backing them up to Gmail.

    • damn.hustle December 10, 2007, 2:36 pm

      thank you very much. You gave an easy explanation.

    • Muthu June 18, 2008, 6:05 am

      Awesome. Simple example which i was waiting to go though in years.

    • Emilio Marte June 25, 2008, 12:37 pm


      Por favor me gustaría que alguien me diga, cómo puedo hacer para que cuando alguien coloque un archivo en un folder cualquiera, que este me notifique o que se active si el mismo está abierto.

      Gracias de antemano

    • Emilio Marte June 25, 2008, 12:40 pm

      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

    • frank July 4, 2008, 11:49 pm

      Ok i give you thumbs up!

    • slub August 26, 2008, 9:51 pm

      Simple, easy and to the point. thank you thank you! I couldn’t find that information anywhere on apple’s site.

    • JoDitt February 21, 2009, 8:32 pm

      Thanks for your simple explanation of folder actions, and especially for the real world examples.

    • Jason Beebe March 7, 2009, 11:09 pm

      Great tip. I will definitely give this a go on my iMac.

    • Mariano April 2, 2009, 7:08 pm

      Thanks for this tutorial.

    • Juergen May 17, 2009, 12:17 pm

      I would like to know what events may trigger a folder action. Unfortunately, I cannot find a reference manual, but it seems like that adding a file is the one and only event which can start a automator script.
      My goal is to implement an action that fires if a folder is opened or closed from a remote host. In this case, iTunesFS should launch. If the connection is closed, the iTunesFS should get closed as well. Any suggestons?

    • Fero June 21, 2009, 5:25 am

      Great script, especially the notify when new file placed in folder.

      Can someone suggest a workaround for Leopard which doesn’t allow you to send a fax, unless you disable ‘Receive faxes on this computer’. I suppose the steps for sending a fax would require the steps;
      – select file to be faxed
      – when ‘Fax Pdf’ is selected, script should ‘deactivate receive fax on this computer’ and save settings and close
      – fax should then send (hopefully)
      – once fax has sent, then script should reinstate ‘receive fax on this computer’ setting.

      THanks all

    • Multimedia Design August 31, 2009, 9:28 pm

      I think you just invented the 30 hour day. This is going to give me so much free time – thanks!

    • Derek Nugent October 30, 2009, 9:37 pm

      Fantastic! Many many thanks for sharing!

    • Luke R April 30, 2011, 8:00 pm

      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.

    • Santosh Koshy July 1, 2011, 5:51 pm

      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..

    • CoastalMaineBird August 18, 2015, 1:41 pm

      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?

    Leave a Comment