how to find files with same name but different extension
I have photos in two formats RAW & JPEG. ( eg DSC1000.CR2 & DSC1000.JPG)These are stored on a daily basis in different folders. I check the JPEG folder and select certain files to delete and put them in the parent folder. ( Thus the day´s folder contains some loose jpegs and one folder for RAWS and one folder for jpegs) I´m trying to write a script which will find the RAWS corresponding to the JPEGS and put them in a new folder. I can get a list of the jpegs in the selected folder but I cannot work out how to query the raws folder.
TIA
Martin
this is what I tried
tell application "Finder"
activate
set folderSelected to (choose folder with prompt "choose the daily folder")
set badfold to make new folder at folderSelected with properties {name:"BADRAWS"}
set goodraws to folder of folderSelected whose name is "03RAWS"
set fileExtension to "jpg"
set badjpegs to name of every file of folderSelected whose name extension is fileExtension as text
set badjpegs to badjpegs as list
set badraws to name of every file of goodraws whose name is in badjpegs
set files2Move to badraws
move files2Move to badfold
reveal badfold
end tell
EMAC, Mac OS X (10.4.8)