Help needed! I’m working on an “approve/reject” script that will run inside an image automating piece of software. We had a version that worked great in 9.2 but now I’m trying to make this work in 10.4.11.
Basically the software “reviews” image files within a group of folders on one computer; each folder has a distinct name, of course; when an “approve” button is clicked, the file should move to a new postprocessing location. The applecscript has to tell the file where to go, based upon which folder it’s currently in (the review folders have names that refer to final destinations.
Anyway, I need to use an “if…then” piece that will run through the the various folders: " If this image is in folder X, then move the processed file to folder Y on remote machine".
Here’s how the snipet worked in 9.2:
property approvedFolderName : "IT Approved"
on approved(origfile, procfile)
try
tell application "Finder"
activate
set newfile to (container of procfile as string) & approvedFolderName
if not (exists (folder newfile)) then
set newfolder to (make new folder at (container of procfile))
set name of newfolder to approvedFolderName
end if
set newfolder to (folder newfile)
move procfile to newfolder
set destfolder to container of procfile as string
if destfolder is "Itune2:Desktop Folder:Intellitune Output:OCHC:IT Approved:" then
duplicate procfile
move procfile to folder "XP2-COLOR In" of desktop
end if
and so on
In 10.4.11 I’ve tried to translate this over but can’t get this to run…
this version
property approvedFolderName : "IT Approved"
on approved(origfile, procfile)
try
tell application "Finder"
activate
set newfile to (container of procfile as string) & approvedFolderName
if not (exists (folder newfile)) then
set newfolder to (make new folder at (container of procfile))
set name of newfolder to approvedFolderName
end if
set newfolder to (folder newfile)
move procfile to newfolder
set destfolder to container of procfile as string
if destfolder is "Intellitune2:Users:intellitune2:Public:INTELLITUNE 4.0 OUTPUT:4OCHC:IT Approved" then
duplicate procfile
move procfile to "Intellitune1:Users:intellitune1:Desktop:TestOutput"
end if
end tell
return 0
on error errStr
display dialog errStr
end try
end approved
this correctly makes the copy and places it into “IT Approved” but WILL NOT send the file to another computer…I’ve stripped this down to just the move part:
SO I’M OBVIOUSLY DOING SOMETHING REALLY BASIC WRONG! Any help would be great!
Thanks!