Timed watched folders
Timed watched folders
- Subject: Timed watched folders
- From: Chad Lindsey <email@hidden>
- Date: Thu, 15 Jan 2004 17:12:56 -0500
Hi all,
I am trying to create a watched folder scipt and having some problems.
The script is to watch a mounted volume on a server, and when a file with a
set naming convention is put into the folder, it is copied to another
mounted server share. The problem is the script tries to copy the files
before they are ready to go (not completely copied there yet) and so the
script errors out.
Here is the script - any ideas on how to improve it?
on adding folder items to this_folder after receiving added_items
repeat
set size_check1 to size of (info for file_)
do shell script "sleep 10"
set size_check2 to size of (info for file_)
if size_check1 is equal to size_check2 then exit repeat
end repeat
tell application "Finder"
repeat with aFile in added_items
try
if the name of aFile contains {"DT"} & {"_cdot"} ,
then
tell application "Finder"
try
copy aFile to folder "ServerFolderA"
on error err
display dialog err
end try
end tell
move aFile to folder "MacHD:Copied" with replacing
else if the name of aFile contains {"DT"} & {"_spot"} then
tell application "Finder"
try
copy aFile to folder "ServerFolderB"
on error err
display dialog err
end try
end tell
move aFile to folder "MacHD:Copied" with replacing
else if the name of aFile contains {"DT"} then
tell application "Finder"
try
copy aFile to folder "ServerFolderC"
on error err
display dialog err
end try
end tell
move aFile to folder "MacHD:Copied:" with replacing
end if
end try
end repeat
end tell
end adding folder items to
Thanks, Chad
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.