PDA

View Full Version : Applying Automator to subfolders


m3j
08-23-2010, 09:35 PM
Hi all,

First post here and a little frustrated. Hoping you can help.

I am using Aperture to import images to specific folders as follows:

1) Imports RAW+JPEG files to folder "Import"
2) Also sends copy to backup location folder "Jpeg Files"
3) Each set of files goes into a subfolder within "Import" and "Jpeg Files" that is labeled with the shot date (so the paths would be ...pictures/"Import"/"shot date" and ...pictures/"Jpeg Files"/"shot date")

Now, the goal is to set a folder action to "Jpeg Files" that would look for the RAW files and delete them, thereby leaving just the JPEG file in the folder labeled with the shot date. Of course, folder "Import" would still have both the RAW and JPEG versions.

I worked with Automator to create a folder action for "Jpeg Files" that would include Find Finder Items and selecting Search "Jpeg Files", then Any-File Extension-Is-"NEF" (NEF is the RAW file extension). I then add Move Finder Items To Trash.

When I run from within Automator, it works perfectly and deletes just the .NEF file. As soon as I apply the action to the folder, however, and run through the steps, it deletes the subfolders containing the NEF file and the JPG file instead of just the NEF file.

What am I doing wrong?? I just want it to delete the file type, not the folders.

Thanks for your help!

renaultssoftware
08-24-2010, 07:07 AM
Try this shell script to do it:
find /Path/To/Folder/With/Raws/ -iname *.NEF -exec mv {} ~/Trash \;
I haven't tried it but it should work.

tw
08-24-2010, 03:45 PM
can you specify precisely the workflow you're using? easiest would be to create a compressed zip file from the workflow and attach that to your next post.

m3j
08-24-2010, 08:50 PM
I'd love to if I could find the bloody workflow. What is with Spotlight searches? This is total crap... I try to type in the workflow name and it doesn't find it. Won't even find the Folder Actions folder. I love my Mac but some simply things like just finding a stinkin file on the HD is ridiculous!

Can you tell me the path to where workflows are saved? I'll then zip it and upload it.

Thanks

PS. In regards to the post with the shell script....that's above my head. Not even sure what to do with that.

tw
08-25-2010, 09:16 AM
I'd love to if I could find the bloody workflow. What is with Spotlight searches? This is total crap... I try to type in the workflow name and it doesn't find it. Won't even find the Folder Actions folder. I love my Mac but some simply things like just finding a stinkin file on the HD is ridiculous!

Can you tell me the path to where workflows are saved? I'll then zip it and upload it.

could be ~/Library/Workflows, ~/Library/Services, or ~/Library/Scripts/Folder Action Scripts. or possible the same in the computer folder (sans ~). Spotlight doesn't search the Library folder by default - you have to tell it to explicitly.

renaultssoftware
08-25-2010, 09:54 AM
In the Finder, go to Applications » Utilities and open Terminal. Paste/type the script in there, edit it as necessary, and press Return. It might be /Users/m3j/Photos/Raws/ or something, where the /path/to… part is there. If you're not sure where, drag the folder in where the path would be to have it automatically insert the path.

CrimsonCrow
09-06-2010, 07:59 AM
Hi all,

What am I doing wrong?? I just want it to delete the file type, not the folders.

Thanks for your help!

From what I can tell you are not doing anything wrong. There seems to be a bug in Automator when dealing with subfolders.

From what I have read online it seems to have been there since at least 2007...How do I know? Because I need an Automator workflow to take 1000s of files from subfolders and move them to a single folder.