Re: on idle() handler in script object
Re: on idle() handler in script object
- Subject: Re: on idle() handler in script object
- From: Matt Neuburg <email@hidden>
- Date: Thu, 25 Aug 2005 09:16:05 -0700
On Thu, 25 Aug 2005 13:24:13 +0100, Simon Forster <email@hidden>
said:
>Folder action script (which is applied to any sub-folders within the
>defined top level folder too). When a file is created in the folder
>(or its sub-folder(s)), the file size is checked every x seconds
>until the file size stops changing at which point the file is copied
>to 3 (sometimes 2) different locations and the event logged. I was
>hoping to create a script object for each file which can then look
>after itself (and its charge). I guess we could have 20 or 30 files.
>Rather than delay x seconds, with its associated overhead, I was
>hoping to get each script object to idle for a couple of seconds.
>
>And yes, I could go all procedural but I did a similar file copying,
>waiting, (copying again), logging job elsewhere and making it object
>orientated is sooooo much easier.
>
>More detail (if you want it). Think high end photo shoots. Digital
>camera-back plugged straight in to G5. As soon as a photo's taken,
>the pic is captured to a folder on the G5. It is then "immediately"
>replicated to 3 different locations (2 are backups, 1 is an edit
>station for instant gratification). Given that each file is going to
>be circa 50MB, we're going to have some time delays while the file is
>downloaded from the camera and then copied to the different locations.
>
>I guess I'll use a technique similar to the one I employed last time
>- basically a queue of script objects which the main script loops
>through. The only tweak would be a time-check routine so that no
>action is taken unless at least x seconds has passed since the last
>check.
>
>Does this make sense? Any improvements you can suggest?
If it were me, and the computer were mine to play with, I might not use an
all-AppleScript solution. The folder action would notify a helper app which
could be threaded and so could watch out for each file separately. But of
course you may not have that option. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden