I do have files contained on an SDHC card that I want to copy onto an external hard drive.
The SDHC card name is SANDISK and the external drive name is NX5U.
The input files to be copied are under the following path:
MP_ROOT:101PNV01
The output folder where the files need to be copied over is
MP_ROOT:101PNV01
I wrote this simple script and do have an error message. Could someone tell me what I’ve done wrong.
Many thanks!
Daniel
tell application "Finder"
with timeout of 0 seconds
-- SDHC card folder (input)
set sourceFolder to folder "MP_ROOT:101PNV01:" of disk "SANDISK" as string
set theCardFiles to files of folder sourceFolder
-- External disk (output)
set ExternalCurrentComp to "Volumes:NX5U:MP_ROOT:101PNV01:"
duplicate theCardFiles to folder ExternalCurrentComp with replacing
end timeout
end tell
return
tell application "Finder"
with timeout of 0 seconds
-- SDHC card folder (input)
set theCardFiles to files of folder "SANDISK:MP_ROOT:101PNV01:"
-- External disk (output)
set ExternalCurrentComp to folder "NX5U:MP_ROOT:101PNV01:"
duplicate theCardFiles to ExternalCurrentComp with replacing
end timeout
end tell
Unfortunately, I get an error message -8082 on the duplicate command.
I’ve made sure the path of the SDHC card and the external drive are correct.
tell application "Finder"
with timeout of 0 seconds
-- SDHC card folder (input)
set theCardFiles to files of folder "SANDISK:MP_ROOT:101PNV01"
-- External disk (output)
set ExternalCurrentComp to folder "NX5U:MP_ROOT:101PNV01:"
try
duplicate theCardFiles to ExternalCurrentComp with replacing
on error the error_message number the error_number
display dialog "Error: " & the error_number & ". " & the error_message buttons {"OK"} default button 1
end try
end timeout
end tell
return
Unfortunately, I had to react to a logistic changes which occurred late yesterday afternoon (last minutes changes, not under my control). Usually I would spent way more time on my own to fix the code. Time is running out on me, I need to get ready by tomorrow and this is why I’ve posted this problem to get help from the forum.
I will dig further and try to see what the problem is with those three lines of code, if I not capable to fix it I still have a plan B which is to perform those actions manually.
Error -8082 is really not obvious, let say it does not mean anything.
Could the fact the SDHC card is used via the Macbook Pro port and the external drive is connected through a USB port on the MacBook Pro make a difference ?