Hi guys,
I've got a digital photographer in the family who is filling up my hard drive with jpeg and raw files. I bought an external drive to hold the pictures. What I've been doing is downloading both the jpegs and the raws files to the external drive, and then just importing the jpegs into iPhoto to save hard drive space.
When I transfer the files off the camera onto the external hard drive, it combines them into one folder. I wrote a script that separates the two different file types into a JpegFolder and a RawFolder, and then plops them on the Desktop.
What I'd prefer to do, is sort them and plop them on the external drive. Then all I will have to do is drag the JpegFolder into iPhoto, thus preserving hard drive space. Problem is, that when I try to do so, I get an error that finder can't access the Folders I created on the external drive.
I submit to you two versions of the script I wrote. The first one works, it just dumps everything onto my desktop.
The second one give me the error. My guess is that my file path to the jpegFolder I created on the external drive is incorrect, but I've tried every way I can think of to access it. Any suggestions would be greatly appreciated...
Version 1:
set SortedFolder to ¬ choose folder with prompt ¬ "Select a Folder to sort your JPEG's" default location (path to pictures folder)
property photoExt : {"jpg", "JPG"}
tell application "Finder"
set jpegFolder to the name of SortedFolder & "JPEG" set rawFolder to the name of SortedFolder & "Raw"
make new folder at desktop with properties {name:jpegFolder} make new folder at desktop with properties {name:rawFolder}
set nFiles to every file of SortedFolder repeat with curFile in nFiles
if the name extension of curFile is in photoExt then move curFile to the folder jpegFolder else move curFile to the folder rawFolder end if end repeat delete SortedFolder end tell
Version 2:
set SortedFolder to ¬ choose folder with prompt ¬ "Select a Folder to sort your JPEG's" default location (path to pictures folder)
property photoExt : {"jpg", "JPG"} set TB to "1 TB Photo Back up:Sorted"
tell application "Finder"
set jpegFolder to the name of SortedFolder & "JPEG" set rawFolder to the name of SortedFolder & "Raw"
make new folder at TB with properties {name:jpegFolder} make new folder at TB with properties {name:rawFolder}
set nFiles to every file of SortedFolder repeat with curFile in nFiles
if the name extension of curFile is in photoExt then move curFile to the folder jpegFolder else move curFile to the folder rawFolder end if end repeat delete SortedFolder end tell
Thanks, Jack
|