You can use Automator to alter what happens when a file is added to a folder. In this example, new files added to a folder are then sorted into subfolders according to their type. You can add multiple actions to a folder and then determine which order they are used.
Want to know more about how to use Automator on your Mac? Check out this MacMost course!
Comments: 27 Responses to “MacMost Now 488: Automator Folder Actions”
Vinz
14 years ago
Gary, just wanted to thank you for making things so easy. I'm a new mac user and became a follower of your website a few months ago.Wonderful and useful tutorials.
Keep up the good job!
Thanx
Edward Bennett
13 years ago
Just wanted to say i really appreciate your video tutorials on all the subjects you cover . They're a big help . Thanks Edward Bennett
Kika Wai'Alae
14 years ago
I follow your instructions and it works for images however you say do the same thing on sounds etc. Well I must be missing something because my songs go into other. So is it kind is music? You don't go step by step only repeat the steps. I'm lost help...
Right "Music" -- you will want to repeat the same workflow, but choose "Music" as the kind to filter by, and then move to the folder named "Audio" if you follow the same naming as I show. You can choose any criteria you want, not just "kind" -- so explore the different options available to you to find some that suit your needs.
Kika Wai'Alae
14 years ago
Ok thanks. Oops after playing around in there and moving a music file my iTunes will not open. Did I mess up my iTunes? :(
Message says iTune folder is on a locked disk or you do not have write permission for this folder.
Sounds like you either changed permissions of you Music folder or iTunes library, or you moved one of them or a subfolder. Or,Mir could be unrelated. Id have an expert take a look.
Kika Wai'Alae
14 years ago
Thanks Gary, I had an Apple tech on the phone for over an hour and he was stumped too. We really didn't change anything in there but after logging in to other accounts and restarting the machine a few times iTunes decided to behave. Must be the rainy Hawaiian weather out here playing games with my BigMac. Thanks for your help, I will once again try to figure this automator thing out.
Aloha
Kika
Drew
14 years ago
Hi Gary,
There must be something wrong with my system (10.6.5). When I create the actions, only the first one in the list works. I even tried creating a new user account and still no joy. I also had a problem with pasting icons into Photoshop a few weeks ago (MacMost #465). It doesn't seem worthwhile for such small problems, but I don't see any solution other than a clean install of the OS, apps, and data.
Drew
Mex
14 years ago
Where's the flattr-button? I'd like flattr this episode...
Scott Pesetsky
14 years ago
Hi Gary,
Thanks for the great lesson. Can I use this process to have Acrobat OCR a document and then save it?
Check to see what Actions that Acrobat adds to Automator (maybe none?). An application like that would typically add actions if it supports Automator. See if one of those actions will help you create a workflow that does what you want.
Benjamin
14 years ago
I try this very helpful hint and I get this error message in Automator when I try to "Save As" when I try to close the program:
"You don't have permission to save the file "Folder Actions" in the folder "Applications". --To view or change permissions, select the item in the Finder and choose File > Get Info.
Just save it elsewhere. Create a folder in your Documents folder to hold scripts you make.
Kevin
13 years ago
I see you didn't really get an answer and I was having this same problem. For me, it didn't matter what folder I tried to attach the script to, I always go this error, indicating permissions issues. Even after fixing disk permissions, no go. So here's what works:
Go to /Users/YourUserName/Library/Workflows/Applications and make the whole directory tree readable and writable to you.
I'm not sure why its not writable to us by default, but after much searching and trial and error, I figured it out and it works. You can make the directories readable and writable in the terminal or just get info on each folder and do it that way.
Cadillac
13 years ago
Gary,
When I try to configure folder actions, I get an error message: Connection failed server does not exist... That just keeps looping. It calls for a server that I don't have any longer.
What do I do to make it stop?
Perhaps you still have an alias or Finder sidebar item that links there? I would just experiment to see if you can get around that error, or figure out what may still be expecting that server to be there. In the Finder when you go Command+K, is the server listed? If so, remove it.
bj_110
13 years ago
Gary,
I've followed your Automator instructions to the letter on my Mac OS 10.5.8 and it refuses to work. I've enabled folder actions added the workflow, removed it, started the same one again, then added it, but still nothing. All I want to do is automatically move any file from my folder called 'scans' that's been dropped in there by my network scanner (it has to be a shared folder with full read/write permissions for the scanner to work) and move it to another non-shared folder so the items scanned can't be viewed by anyone else on the network. I'm at a loss as to why it's not working
Not sure. Maybe a problem with Leopard (vs Snow Leopard). Does it work if you drag and drop them in there (as opposed to them being created by the scanner)?
bj_110
13 years ago
Sorry, it's 10.6.8 Snow Leopard not Leopard as previously mentioned.
bj_110
13 years ago
It still doesn't work if I manually drop them in there from another folder.
Not sure. Hard to say without being there. Perhaps have someone who has done some Automator work before give you a hand. Or, visit the Apple store and see if you can get some instruction. Or, just continue to try to trouble-shoot the problem and see if you can figure it out.
guebert
12 years ago
Hi Gary, I tried your workflow and it did not work on my computer. No error message just no effect. After some googleing I learned that the "Filter Finder items" action only works on items that have been indexed by Spotlight.
As I have disabled the indexing of my HD this workflow did not work. Maybe some other viewers have had the same experience. Anyway, love your vidcasts, please keep up the great work.
Ivan
13 years ago
Thanks everybody for your ideas.
Could someone post an Automator workflow example for the following:
I want to find folders that contain ONLY one kind of file but which does not contain any other, i.e., I want to search inside my music folders and find any folder that contain only .jpg files, but no music files on them.
That will probably require some AppleScripting (using the AppleScript programming language inside of Automator). Tough to do if you are not a programmer, I'm afraid.
Adam Davidson
13 years ago
Hi Gary, thanks for the great tutorial.
I have a conundrum for you: I want to do something like this on my downloads folder, but for example, move new episodes of "CSI" to the CSI folder, new episodes of "The Mentalist" to the Mentalist folder, etc... Your tutorial is great, however I've got 30-odd shows on a scheduled download. Do I have to create a folder action for each show I add? or is there a way to automate this based on checking the filename against a list of existing folders into which they should go?
Gary, just wanted to thank you for making things so easy. I'm a new mac user and became a follower of your website a few months ago.Wonderful and useful tutorials.
Keep up the good job!
Thanx
Just wanted to say i really appreciate your video tutorials on all the subjects you cover . They're a big help . Thanks Edward Bennett
I follow your instructions and it works for images however you say do the same thing on sounds etc. Well I must be missing something because my songs go into other. So is it kind is music? You don't go step by step only repeat the steps. I'm lost help...
Right "Music" -- you will want to repeat the same workflow, but choose "Music" as the kind to filter by, and then move to the folder named "Audio" if you follow the same naming as I show. You can choose any criteria you want, not just "kind" -- so explore the different options available to you to find some that suit your needs.
Ok thanks. Oops after playing around in there and moving a music file my iTunes will not open. Did I mess up my iTunes? :(
Message says iTune folder is on a locked disk or you do not have write permission for this folder.
Sounds like you either changed permissions of you Music folder or iTunes library, or you moved one of them or a subfolder. Or,Mir could be unrelated. Id have an expert take a look.
Thanks Gary, I had an Apple tech on the phone for over an hour and he was stumped too. We really didn't change anything in there but after logging in to other accounts and restarting the machine a few times iTunes decided to behave. Must be the rainy Hawaiian weather out here playing games with my BigMac. Thanks for your help, I will once again try to figure this automator thing out.
Aloha
Kika
Hi Gary,
There must be something wrong with my system (10.6.5). When I create the actions, only the first one in the list works. I even tried creating a new user account and still no joy. I also had a problem with pasting icons into Photoshop a few weeks ago (MacMost #465). It doesn't seem worthwhile for such small problems, but I don't see any solution other than a clean install of the OS, apps, and data.
Drew
Where's the flattr-button? I'd like flattr this episode...
Hi Gary,
Thanks for the great lesson. Can I use this process to have Acrobat OCR a document and then save it?
Scott
Check to see what Actions that Acrobat adds to Automator (maybe none?). An application like that would typically add actions if it supports Automator. See if one of those actions will help you create a workflow that does what you want.
I try this very helpful hint and I get this error message in Automator when I try to "Save As" when I try to close the program:
"You don't have permission to save the file "Folder Actions" in the folder "Applications". --To view or change permissions, select the item in the Finder and choose File > Get Info.
Just save it elsewhere. Create a folder in your Documents folder to hold scripts you make.
I see you didn't really get an answer and I was having this same problem. For me, it didn't matter what folder I tried to attach the script to, I always go this error, indicating permissions issues. Even after fixing disk permissions, no go. So here's what works:
Go to /Users/YourUserName/Library/Workflows/Applications and make the whole directory tree readable and writable to you.
I'm not sure why its not writable to us by default, but after much searching and trial and error, I figured it out and it works. You can make the directories readable and writable in the terminal or just get info on each folder and do it that way.
Gary,
When I try to configure folder actions, I get an error message: Connection failed server does not exist... That just keeps looping. It calls for a server that I don't have any longer.
What do I do to make it stop?
And, automatically add to itunes is in red.
Perhaps you still have an alias or Finder sidebar item that links there? I would just experiment to see if you can get around that error, or figure out what may still be expecting that server to be there. In the Finder when you go Command+K, is the server listed? If so, remove it.
Gary,
I've followed your Automator instructions to the letter on my Mac OS 10.5.8 and it refuses to work. I've enabled folder actions added the workflow, removed it, started the same one again, then added it, but still nothing. All I want to do is automatically move any file from my folder called 'scans' that's been dropped in there by my network scanner (it has to be a shared folder with full read/write permissions for the scanner to work) and move it to another non-shared folder so the items scanned can't be viewed by anyone else on the network. I'm at a loss as to why it's not working
Not sure. Maybe a problem with Leopard (vs Snow Leopard). Does it work if you drag and drop them in there (as opposed to them being created by the scanner)?
Sorry, it's 10.6.8 Snow Leopard not Leopard as previously mentioned.
It still doesn't work if I manually drop them in there from another folder.
Not sure. Hard to say without being there. Perhaps have someone who has done some Automator work before give you a hand. Or, visit the Apple store and see if you can get some instruction. Or, just continue to try to trouble-shoot the problem and see if you can figure it out.
Hi Gary, I tried your workflow and it did not work on my computer. No error message just no effect. After some googleing I learned that the "Filter Finder items" action only works on items that have been indexed by Spotlight.
As I have disabled the indexing of my HD this workflow did not work. Maybe some other viewers have had the same experience. Anyway, love your vidcasts, please keep up the great work.
Thanks everybody for your ideas.
Could someone post an Automator workflow example for the following:
I want to find folders that contain ONLY one kind of file but which does not contain any other, i.e., I want to search inside my music folders and find any folder that contain only .jpg files, but no music files on them.
That will probably require some AppleScripting (using the AppleScript programming language inside of Automator). Tough to do if you are not a programmer, I'm afraid.
Hi Gary, thanks for the great tutorial.
I have a conundrum for you: I want to do something like this on my downloads folder, but for example, move new episodes of "CSI" to the CSI folder, new episodes of "The Mentalist" to the Mentalist folder, etc... Your tutorial is great, however I've got 30-odd shows on a scheduled download. Do I have to create a folder action for each show I add? or is there a way to automate this based on checking the filename against a list of existing folders into which they should go?
You might be able to do that using some AppleScript -- if you know how to program.