Hi Luther, sorry I took so long to thank you for your suggestion. Apologies to Chris Stone also. I had my email filters set incorrectly.
I tried your suggestion...
A suggestion. Replace this ... set TB to "1 TB Photo Back up:Sorted"
with property TB : alias "1 TB Photo Back up:Sorted" I don't think 'make new ...' understands strings.
Unfortunately, I got the same result.
What's happened is as follows...
The script makes the new folder on the external drive as planned. The folders are empty initially.
During the "if then else" loop, when I try to move the sorted JPEG and Raw files into the waiting folders, I get the error...
"Finder got an error: Can't get folder \"yada yada\"
Here's a copy again of the script...
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 -- This is where the script gives me the error. else move curFile to the folder rawFolder end if end repeat delete SortedFolder end tell
Anyway, I did some more research on it, and found the answer. I was correct in thinking that my file path was to blame. The answer lies in adding one more folder inside the "if, then else" loop...
if the name extension of curFile is in photoExt then move curFile to the folder jpegFolder of folder TB else move curFile to the folder rawFolder of folder TB end if
Thanks again to both Luther and Chris for your suggestions. I really appreciate it.
Jack
|