I'm trying to set a Folder Action that will move all of the files that are in my downloads folder into their appropriate folders so that I don't have to do them manually. (movies to movie folder, music to music folder etc...)

Is there a way I can do this in a Folder Action without having to create separate Folder Action script for each type of file?

2 Answers 2


You can use a shell script like this:

for f; do
  case $f in
    *.mp3|*.m4a) mv -n "$f" ~/Music;;
    *.jpg) mv -n "$f" ~/Pictures;;
    *) mv -n "$f" ~/Documents;;

mv -n skips a file when a file with the same name exists in the target.


The must have to do that is "Hazel" from noodlesoft : http://www.noodlesoft.com You can add folders in Hazel and for each folder you can add multiple rules. Hazel windiw Exemple of a rule for musics

  • 1
    So, there's no way for me to do this with Folder Actions? Mar 17, 2014 at 0:59
  • Which OS X is installed on your Mac ? On Mavericks the folder actions seems to have disappeared. The last time I've tried to use the "Folder Actions" was on Tiger ^^ Maybe you can do the same with Folder Actions but it probably require that you code a script in AppleScript. Hazel is more powerfull and simple !! If you're Mac running an old OS X versions you can find the right Hazel version for your Mac here : noodlesoft.com/old_versions.php
    – Thibault
    Mar 18, 2014 at 12:48
  • Sorry the Folders Actions are already there on Mavericks but Hazel stay better. YOu maybe can do an action with Automator but good luck. In hazel the same thing can done in 2min instead of 30min with Automator ^^
    – Thibault
    Mar 18, 2014 at 13:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .