Applescript get file failure

I'm trying to automate backups of my Parallels virtual machine and am running into trouble with AppleScript getting the specified file. Here's my script:

tell application "Keyboard Maestro Engine"
	set KM_file_to_copy to "/Users/Shared/Parallels/Windows 10.pvm"
	set KM_destination to "/SJH T5/Parallels/"	
end tell

tell application "Finder"
	--copy file KM_file_to_copy to KM_destination
	get file KM_file_to_copy
end tell

I will actually use the commented out copy file line, but for testing I am using get file since that doesn't actually copy an 80GB file. Both versions get the same error:

error "Finder got an error: Can’t get file \"/Users/Shared/Parallels/Windows 10.pvm\"." number -1728 from file "/Users/Shared/Parallels/Windows 10.pvm"

I know the file exists at that path because I dragged the file into Script Editor to get the path. I've played with /, , and : in the file name to no avail.

Can anyone point me to what I am not understanding here? This should be super simple.

Edit: One other thing... I am using Applescript for this instead of the KM copy action because I want the progress bar to be displayed. This one takes a while.

I think that space in the filename and subsequent path are the issue. You might try copyring to the POSIX path of the file and destination.

@shovland42:

Actually the Finder app requires either a file HFC path, or an alias. Alias is best.

set KM_file_to_copy to POSIX file "/Users/Shared/Parallels/Windows 10.pvm" as alias

But why are you using AppleScript? Just use native KM Actions, and you can use POSIX paths like you have:

image

I’d continue to use the built in command if it gave some sense of progress, but there isn’t any feedback until completion and this copy takes a half hour when going to a spinning drive. (The T5 only takes about 3 minutes... color me spoiled.)

I’ll try the posix pAth tomorrow. Thanks for the assistance.