0
votes

When I take pictures using RAW+JPG I sometimes need to delete all the JPG's. How can I set Automator in OSX to search and delete all the files with .JPG extension within the folder and its subfolders?

I researched and tried everything but I can't get anything to work.

I made a workflow: "Get selected Finder Items" -> Get Folder Contents (repeat for each subfolder found) -> Filter Finder Items (file extension is JPG) -> Move Finder Items to Trash. It works if the folder is copied on the computer, but I need it to work on the SD card, which it doesn't.

Any help would be highly appreciated.

1
Command-line solutions from SU: superuser.com/q/241333/429992Tamás Sengel
"I researched and tried everything" - can you show us what you've tried ?CJK
For instance, the last try was as follows: I made a workflow: "Get selected Finder Items" -> Get Folder Contents (repeat for each subfolder found) -> Filter Finder Items (file extension is JPG) -> Move Finder Items to Trash. It doesn't work.Ovi
OK. The above seems to work if the folder is on the computer, but it doesn't if I run the workflow on a folder on the sd card.Ovi

1 Answers

0
votes

I did it using "Run Shell Script".

Get Selected Finder Itens -> Run Shell Script

You need to set "Pass input: as arguments" and the script will be:

find "$1" \( -iname \*.jpg -o -iname \*.jpeg \) -type f -delete

Hope it can be helpful