File Copy Completed
Fires when a single transfer completes.
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.
Example
02/01/2022, 11:42 - File copy completed: {
"FileCopyCompleted_bytesCopied" = 823549835;
"FileCopyCompleted_destinationPath" = "/Users/Hedge/Project X/CAM A/001";
"FileCopyCompleted_duration" = "6.256199";
"FileCopyCompleted_mode" = "Backup";
"FileCopyCompleted_verification_mode" = "Source & Destination";
"FileCopyCompleted_presetName" = "Project X";
"FileCopyCompleted_sourceInfo" = {
"Source Name" = "Untitled";
"Location = "London"
"Counter" = "003"
};
"FileCopyCompleted_sourcePaths" = "/Volumes/UNTITLED";
"FileCopyCompleted_startedAt" = 20190102114226;
"FileCopyCompleted_state" = Success;
}
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