Re: on idle() handler in script object
Re: on idle() handler in script object
- Subject: Re: on idle() handler in script object
- From: Simon Forster <email@hidden>
- Date: Thu, 25 Aug 2005 13:24:13 +0100
On 24 Aug 2005, at 18:54, has wrote:
Does nothing (unless you call it). idle handlers aren't magical;
they just respond to periodic idle() events sent by the application
shell to the top-level script.
Thank you (and Matt). I hadn't understood how the mechanism worked -
hence my posting. You'll be relieved to know that my test last night
failed ;-)
If you describe what it is you're trying to achieve, maybe a
solution can be suggested.
Oh dear, you had to ask!
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?
TIA
Simon Forster
_____________________________________________________
LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK
Tel: +44 (0)70 9230 5244 Fax: +44 (0)70 9230 5247
_____________________________________________________
_______________________________________________
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