This event fires for all transfer end states (Success, Failed, Warnings, Canceled, and Stopped). Make sure to check the FileCopyCompleted_state variable in your script.
Example
set FileCopyCompleted_state to "{FileCopyCompleted_state}"
if FileCopyCompleted_state is not "Success" then return false
Copying a source to two destinations will fire two separate File Copy Completed events, plus three Disk Idle events.
All set values are returned as Strings. In case of FileCopyCompleted_sourceInfo a JSON object is returned as a String. To use it in AppleScript, you can use the following code:
set FileCopyCompleted_sourceInfo to "{FileCopyCompleted_sourceInfo}"
set FileCopyCompleted_sourceInfoRecord to run script (do shell script ("echo " & FileCopyCompleted_sourceInfo's quoted form & " | sed -E 's/\"([^\"]+)\"[[:space:]]*:[[:space:]]*/|\\1|:/g' | tr -d '\\n\\r'"))
display alert |Location| of FileCopyCompleted_sourceInfoRecord
display alert |Counter| of FileCopyCompleted_sourceInfoRecord
display alert |Source Name| of FileCopyCompleted_sourceInfoRecord
Last updated
This site uses cookies to deliver its service and to analyse traffic. By browsing this site, you accept the privacy policy.