Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

lukedavidh

macrumors newbie
Original poster
Aug 7, 2015
2
0
tell application "Finder"

duplicate (every file of {"Volumes:MyPassportForMac:FamilyVac2014} whose name extension is in {".JPG"}) to folder "AllFamVacJPEGS" of desktop

end tell
 
Ahh, yes. newbie mistake. still doesn't work, says

SCRIPT ERROR
Can’t get {} whose {".JPG"} contains name extension.
 
Try this :

Code:
tell application "Finder"
    duplicate (files of folder "Volumes:MyPassportForMac:FamilyVac2014:" whose name extension is "jpg") to folder "AllFamVacJPEGS" of desktop
end tell
 
Got it, this worked for me:

Code:
tell application "Finder"  

duplicate (every file of ("Volumes:MyPassportForMac:FamilyVac2014" as alias) whose name extension is "jpg") to folder "AllFamVacJPEGS" of desktop

end tell

You need to pass the volume path as an alias. You don't need the brackets on the jpg extension either because it's only that one and not tiff/gif/etc.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.