This script won't wait
This script won't wait
- Subject: This script won't wait
- From: Phil Brodd <email@hidden>
- Date: Tue, 24 Jul 2001 20:59:14 -0500
(Mac OS 9.1, AppleScript 1.6)
I'm writing a script to synchronize some files over the network. There is a
particular file that the user can choose to preserve, even if there is a
different copy on the sync server. My first thought was simply to duplicate
the file to another location, then move it back when the sync is finished,
replacing the newer copy.
To my surprise, the script sometimes doesn't wait until the sync is finished
to copy the original file back, and the file is overwritten. I banged my
head against this, finally coming up with this kludge:
set sync_pro_is_running to true
tell application "Finder"
repeat until sync_pro_is_running is false
if the name of every process does not contain "Synchronize! Pro"
then
set sync_pro_is_running to false
end if
end repeat
if ini_preference is "Leave it alone" then
duplicate file unreal_ini_backup to folder unreal_system_folder
with replacing
else if ini_preference is "Sync it" then
delete file unreal_ini_backup
end if
end tell
However, this seems to be no more reliable than before. Can anyone explain
what's going on here?
Phil