Hello all, I’m working on a script to automate a backup procedure and I have come across a snare. The script reports an error while waiting for the copy to finish. The error is related to Finder and an AppleEvent timing out. Is there a way to get the script to wait till the copy is finished? here’s the code:
property theMonths : {January, February, March, April, May, June, July, August, September, October, November, December}
set theDate to current date
set theDay to the day of theDate
set theYear to the year of theDate
set theMonth to the month of theDate
repeat with x from 1 to 12
if theMonth = (item x of theMonths) then
set theMonth to x
exit repeat
end if
end repeat
set theName to theMonth & theDay & theYear as text --"1302002"
tell application "Finder"
activate
select folder "libraryworld" of folder "Headquaters" of folder "Documents" of startup disk
copy selection to folder "Backup" of folder "Documents" of startup disk
select folder "libraryworld" of folder "Backup" of folder "Documents" of startup disk
set name of selection to theName
end tell
Thanks, Daniel Decker