I’ve had a quick search but couldnt find this question being raised before, but I apologise if it has and I’ve missed it.
I’m trying to write a droplet type script that allows me to drop in one or more folders containing raw photos from my nikon camera (.NEF), and with each folder, create a subfolder called “Raw” and move all the .NEF files into that. I’m having difficulty getting the move to work though, and this is my first apple script so I’m getting a bit stumped.
Here’s what I’ve got so far:
on open these_items
repeat with i from 1 to the count of these_items
set this_item to (item i of these_items)
set the item_info to info for this_item
if folder of the item_info is true then
tell application "Finder"
-- The name of the folder to put NEF files into
set rawFolderName to "Raw"
make new folder at this_item with properties {name:rawFolderName}
move every item of folder this_item to rawFolderName
end tell
end if
end repeat
end open
When I run this, I get an error saying can’t get every item of <> … Presumably this is because the move x to y needs y to be an absolute path of drive:folder:folder:folder style, and I’m not giving it one. If that’s the case, how do I concatenate my rawFolderName variable onto the location of this_item? I would also like to only move files ending in .NEF, but couldn’t figure that out either. Something to do with item_info?
Thanks!
Model: PowerBook (current rev) 1.5GHz/1Gb/80Gb
AppleScript: 1.10
Browser: Firefox 1.0.6
Operating System: Mac OS X (10.4)