Re: tell Grog to glog
Re: tell Grog to glog
- Subject: Re: tell Grog to glog
- From: Axel Luttgens <email@hidden>
- Date: Tue, 09 Jan 2007 22:53:42 +0100
On 7/01/07 22:46, Gil Dawson wrote:
At 8:25 P +0100 1/7/07, Axel Luttgens wrote:
Sorry if my cosmetic changes somehow have
hidden the important piece.
It works here because of the "ignoring application responses" block in
the calling script...
Ah, so! Now this begins to make sense. So the call to glog triggered
the run handler, which returned nothing. The parameter in the call to
glog was just lost, eh?
To make a model of these findings so I can remember it:
The first call to an unlaunched app will only run the run handler. We
must wait (2 seconds or so) until the app is finished launching before
we can address the app's other handlers.
Well, the 2 second rule is not an absolute one...
In this precise case, I introduced that delay in the calling script so
as to allow sufficient time for Grog.app's dialog to dismiss (which I
gave a 1 second delay in the "giving up after" argument).
Now, as Luther has pointed, using the launch command from the calling
script avoids to have Grog.app's run handler to be run at all.
But the asumptions about the role/nature of Grog.app are then very
different than the ones implied by your sample scripts.
For example, if you want Grog.app to stay open for at least 10 seconds,
its StartTime global must have been somehow initialized, for example by
a double-click on its icon.
Otherwise, each invocation of glog() from the calling script would
result in launching Grog.app, executing its glog() handler, then
quitting it; not a very efficient way to have Grog.app behaving as a
fully fledged application as well as a script library.
Anyway, in a whole, you allowed all of us to remember some fundations
of AS!
Thanks,
Axel
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users
This email sent to email@hidden