Hi all,
first of all sorry, this might be an absolute newby question, but I the search through the archives didn’t reveal an answer to my question.
as the subject says, I am trying to duplicate all files of a folder into another folder.
I would like to have a status bar, so I thought “tell the finder to duplicate” would be appropriate.
The script I came up with works, but is very slow compared to
a.) a drag and drop action in the finder
b.) an automator action to copy the files
c.) a script which “does shell script ‘ditto’” to copy the files
all three above methods perform on my 300 MB folder in more or less 1 minute, whereas the “tell finder to duplicate” version takes 5 (!!) minutes.
there MUST be something I am doing wrong as automator is also an applescript and out performs my version by a factor of 5!
being a newby to applescript my first guess is that I am doing something stupid.
anyway here’s what I tried:
on run
with timeout of 40 * days seconds
tell application “Finder”
set foldername to “HD:Users:alex:Work:testfolder:”
set theFolder to foldername as alias
make new folder at theFolder with properties {name:“test”}
set srcFolder to (foldername & “version2:”) as alias
set targetFolder to foldername & “test:” as alias
try
duplicate files of srcFolder to targetFolder
on error e
activate
beep
display dialog e buttons {“Ok”} default button 1 with icon 2
end try
end tell
end timeout
end run
and here is the shellscript version (I a bit more familiar with shell scripts, but it won’t show a nice progress bar)
on run
with timeout of 40 * days seconds
do shell script “ditto -rsrc ~/Work/testfolder/version2/* ~/Work/testfolder/test/”
end timeout
end run
Model: PB G4-1.25
Browser: Safari 419.3
Operating System: Mac OS X (10.4)