• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Timed watched folders
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Timed watched folders
      • From: Matthew Smith <email@hidden>
    • Re: Timed watched folders
      • From: Rob Jorgensen <email@hidden>
  • Prev by Date: Re: Script expects quoted text mystery
  • Next by Date: Re: Working With Records
  • Previous by thread: Re: Address Book: Delete Person (still can't)
  • Next by thread: Re: Timed watched folders
  • Index(es):
    • Date
    • Thread