Please feel free to clean up.
on CopyAssetsToServer() -- with timeout of 1 second -- mount volume "<protocol>://<user>:<pass>@<ip>/<share>" -- end timeout
-- mount server
set mySourceFolder to pOptimizedPNGPath & ":" & pDocumentName -- set myTargetFolder to (the quoted form of POSIX path of "Volumes:Assets:") -- pDocumentName
tell application "Finder" set myTargetFolder to (the quoted form of POSIX path of "Volumes:Assets:") -- pDocumentName -- set myTargetFolder to path to "Volumes:Assets:" try set myTargetFolder to disk "assets" on error myError number myMessage log myError & " " & number & " " & myMessage end try end tell
-- set myTargetFolder to Volume "Assets"
try with timeout of 2 seconds tell application "Finder" mount volume myServer -- with username "graphics" with password "" end tell end timeout on error log "mount error" end try
say "Copying files to staging server." using "Alex" set myMessage to "Copy complete." -- copy files tell application "Finder" try duplicate mySourceFolder to myTargetFolder with replacing on error set myMessage to "Copy failed. Please copy the folder to the assets volume manually." end try end tell say myMessage using "Alex" end CopyAssetsToServer |