Re: Timed watched folders
Re: Timed watched folders
- Subject: Re: Timed watched folders
- From: Rob Jorgensen <email@hidden>
- Date: Thu, 15 Jan 2004 18:44:54 -0500
At 5:12 PM -0500 1/15/04, Chad Lindsey wrote:
>
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?
It looks like your size check routine wasn't hooked up. Does this work?
on adding folder items to this_folder after receiving added_items
repeat with aFile in added_items
repeat
set size_check1 to size of (info for aFile)
do shell script "sleep 10"
set size_check2 to size of (info for aFile)
if size_check1 is equal to size_check2 then exit repeat
end repeat
tell application "Finder"
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 tell
end repeat
end adding folder items to
-- Rob
_______________________________________________
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.