5 Replies Latest reply: Aug 18, 2013 7:37 PM by TroyDWhite
itsasinch Level 1 Level 1 (0 points)

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)
  • red_menace Level 6 Level 6 (14,760 points)

    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

  • itsasinch Level 1 Level 1 (0 points)

    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?

  • red_menace Level 6 Level 6 (14,760 points)

    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.

  • TroyDWhite Level 1 Level 1 (0 points)

    I was able to get this to work by using Copy Finder Items instead of Move Finder Items.

     

    I assume the reason move doesn't work is because it removes the file and doesn't allow the rest of the service to complete (but I'm not sure).

     

    I use this service to filter images, MP3's and dmg files that I download via Chrome to 3 different folders.