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 thoughts on “Folder Actions for OS X explained – with real-world examples”

    1. Pingback: Jay’s Headspace - » Eager Beaver for 01/31/2007

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

    3. Pingback: Folder Action for automated upload of Aperture web galleries at The Joy of Scripting

    4. Pingback: Final Cut Producer | Mac Folder Actions Explained

    5. Pingback: Looky: An AppleScript Folder Action utilizing Quick Look at The Joy of Scripting

    6. Pingback: AppleScript ::: Ignorantenprogramm released | macfidelity

    7. Saludos:

      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

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

    9. Pingback: Folder Actions for OS X explained (with real-world examples) | The Pengas Blog

    10. Pingback: New Item Alert « MilkHub

    11. Pingback: Automator to Convert Torrents with iSquint? - MacNN Forums

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

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

    14. Pingback: An Applescript to Move Screenshots From the Desktop — Ken Clark's Blog

    15. Pingback: Folder Actions, UNIX style « Hello Mac World

    16. Pingback: NMDNet » Microsoft Tag Beta

    17. Pingback: Think More Different « MadBob

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

    19. Santosh Koshy

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

    20. Pingback: Sweet App: QuickShot — Shawn Blanc

    21. Pingback: » AppleScript: Using Folder Actions to Sync Folders

    22. Pingback: How to Print From iOS to Any Printer Using IFTTT , Dropbox and Automator | MacTrast

    23. Pingback: Use Dropbox to Create a Yojimbo iPhone App | Nine Boxes

    24. Pingback: Mac Master Series Quick Tip: Folder Actions In OS X Help You Keep Your Sanity (Even In The Darkest Of Times) | Fedora Outlier LLC.

    25. Pingback: IFTTT for automation - connecting the tubes together - Beardy Says!

    26. Pingback: » Automatic screenshot uploading on Mac like Cloud App

    27. CoastalMaineBird

      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?

    28. Pingback: Mac Master Series Quick Tip: Folder Actions In OS X Help You Keep Your Sanity (Even In The Darkest Of Times) | Mac Master Series

    29. Pingback: Folder Actions In OS X Help You Keep Your Sanity (Even In The Darkest Of Times) – Teach Institute

    Leave a Comment

    Your email address will not be published. Required fields are marked *