I'm very new to writing applescript, but have been painfully working through it.
I have successfully written scripts to download specific csv attachments from an email inbox, then create an SQL insert statement from them. I'm now trying add a statement to move the original file to an archive folder so the SQL insert script does not act on those files the next time it runs. The variable"DEP_name" is the name of the file captured earlier in the script:
tell application "Finder"
set orgpath to "Macintosh HD:Users:me:Documents:source_folder:" as string
set originalFolder to (orgpath & DEP_name) as string
set newpath to "Macintosh HD:Users:me:Documents:Archive:" as string
set newFolder to (newpath & DEP_name) as string
move originalFolder to newFolder with replacing
end tell
With this version I get the error: "Finder got an error: AppleEvent handler failed." I have also tried using the Posix file path, but I am getting a different error with that attempt. Any help would be appreciated.