Re: Timed watched folders
Re: Timed watched folders
- Subject: Re: Timed watched folders
- From: Rob Jorgensen <email@hidden>
- Date: Fri, 16 Jan 2004 15:31:50 -0500
At 1:23 PM -0500 1/16/04, Geoff Graham wrote:
On Jan 16, 2004, at 12:06 PM, Rob Jorgensen wrote:
At 11:48 AM -0500 1/16/04, Geoff Graham wrote:
On Jan 16, 2004, at 10:25 AM, Rob Jorgensen wrote:
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
busy status of (info for aFile) works too.
Hi Geoff,
I've found that busy status is not reliable (in OS X anyway) since
it is dependent on applications which set the flag. :/
you know, i meant to reply to the list. sorry.
No prob.
That is sad to hear. I have a watched folder that my pdf "printer"
saves to. the folder action renames it, then moves it to the out
folder. Sometimes the file remains and the moved file is 0 bytes in
size; this thread clued me in that it is not finished printing when
the Finder attempts the move. Or maybe the problem is just an error
on my part: but it has succeeded twice since I wrapped it in an "is
busy" repeat loop.
But back to the part about making it harder than it has to be, I
don't remember having this problem before (os9), I thought the
"after receiving" part of:
on adding folder items to theFolder after receiving theAddedItems
means -finished- receiving. If not, surely the Finder at least sets
the busy status?
if neither, then that size comparison loop would be mandatory for
all adding folder items actions.
Finder might set the busy flag but my folder action script watches my
download folder and Safari doesn't appear to set the flag. I don't
think that the "after receiving" part of a folder action considers
the status of a file that is being copied or downloaded. As soon as
it detects a file, complete or not, it kicks into action (at least
that's my experience in OS X). This is the reason that I use a size
check routine.
-- 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.