Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Using Automator to filter and send files within a folder to different destinations?

Hi Apple Community,


So here's what I want to do. I want this Automator service to (upon Ctrl+Clicking on a folder) filter the files within the folder and send them to different destinations, based on the file type. More specifically, I want the music files in said folder to be sent to the "Automatically Add to iTunes" folder, and any image files in the folder (*hint* album artwork) to be sent to a separate folder on the desktop entitled "Album Artwork" (creative, I know).


I have a very basic knowledge of Automator functions (at least the ones not requiring Applescript). I KNOW there is an easy way to do this, but I'm simply not finding the right actions. Thanks!


Spencer

OS X Mountain Lion (10.8.3)

Posted on Apr 3, 2013 11:13 AM

Reply
5 replies

Apr 3, 2013 1:33 PM in response to itsasinch

You can create a Service workflow to get the folder(s). The workflow would consist of actions to save the input items to a vatiable (so they can be refiltered), then get the input items, apply a filter, and move the resulting items - for example:


Service receives selected folders in Finder

  1. Get Folder Contents
  2. Set Value of Variable { Variable: Original Items }
  3. Filter Finder Items { Find files where: kind is music }
  4. Move Finder Items { To: Automatically Add to iTunes }
  5. Get Value of Variable { Variable: Original Items } ( Ignore Input )
  6. Filter Finder Items { Find files where: kind is image }
  7. Move Finder Items { To: Album Artwork }


...repeat the Get/Filter/Move actions as needed for other filters

Apr 3, 2013 5:00 PM in response to red_menace

red_menace wrote:


You can create a Service workflow to get the folder(s). The workflow would consist of actions to save the input items to a vatiable (so they can be refiltered), then get the input items, apply a filter, and move the resulting items - for example:


Service receives selected folders in Finder

  1. Get Folder Contents
  2. Set Value of Variable { Variable: Original Items }
  3. Filter Finder Items { Find files where: kind is music }
  4. Move Finder Items { To: Automatically Add to iTunes }
  5. Get Value of Variable { Variable: Original Items } ( Ignore Input )
  6. Filter Finder Items { Find files where: kind is image }
  7. Move Finder Items { To: Album Artwork }


...repeat the Get/Filter/Move actions as needed for other filters


Thanks, the "Set Value of Variable" concept is what I was missing. It almost works. The music files get moved, but then it says the workflow encounters a problem and the image files aren't being moved. I'm assuming it's an issue with steps 5-7. Thoughts?

Apr 3, 2013 5:35 PM in response to itsasinch

If you run the workflow from Automator (you will need to temporarily add an action such as Ask for Finder Items to get something to work with) you can look at the log for a specific error message or the output results of an action to see what is happening. Check what is being output from the Get Value of Variable and the second Filter Finder Items actions.

Using Automator to filter and send files within a folder to different destinations?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.