This will move all the files in the chosen folder, that have
an extension of “raw”, to the trash.
--Choose the folder containing the pictures
set theFolder to choose folder
tell application "Finder"
set thePics to every file of theFolder
--Loop through each picture and see
--if the name extension is "raw"
--if it is then move it to the trash
repeat with i from 1 to count the thePics
set thisPic to item i of thePics as alias
set thisExt to name extension of thisPic
if thisExt = "raw" then
move thisPic to the trash
end if
end repeat
end tell
hi graig
Thanks for your reponse
maby my first post is not too clear.
My camera takes photos in jpg or raw format.
when i take a photo in raw it automatically generates a jpeg image of that shot
What i want to achieve is a workflow that sends photos taken only in jpg direct to iphoto and the raw images to aperture and trows away the accompanying jpg images. I don’t want the jpg’s that came with the raws to be imported in iphoto nor imported in aperture.
in steps i imagine the workflow when i import a jpg (A.jpg) and a raw (B.raw and B.jpg) like this
1 copy the images from the card to the computer
2 make a script that sees B.raw and throws away B.jpg
3 import A.jpg in iphoto
4 import B.raw in aperture
1-3-4 I managed to do in automator
For 2 I think I have to make some if /then rule
if B.raw exist then throw away B.jpg
but i haven’t a clue how to do this
set targetFolder to choose folder default location alias ((path to desktop folder as Unicode text) & "JPG-RAW Test:")
|remove JPG for RAW|(targetFolder)
to |remove JPG for RAW|(fldr)
tell application "Finder"
try
if class of fldr is not folder then set fldr to folder fldr
end try
ignoring case
set rawNames to name of files of fldr whose name ends with ".raw"
end ignoring
end tell
set jpgsWithRaw to {}
repeat with n in rawNames
-- we know they end in .raw, just trim off the last 4 characters and add ".jpg"
set jpgName to text 1 through -5 of contents of n & ".jpg"
ignoring case
tell application "Finder" to ¬
set jpgsWithRaw to jpgsWithRaw & (files of fldr whose name is jpgName)
end ignoring
end repeat
tell application "Finder" to delete jpgsWithRaw
end |remove JPG for RAW|
Model: iBook G4 933
AppleScript: 1.10.7
Browser: Safari 3.0.4 (523.12)
Operating System: Mac OS X (10.4)