Re: Called script won't store property
Re: Called script won't store property
- Subject: Re: Called script won't store property
- From: kai <email@hidden>
- Date: Tue, 1 Mar 2005 21:49:53 +0000
On Mon, 28 Feb 2005 22:16:41 +0000, has wrote:
Applets load their stored script when launched and store the updated
version, replacing the original, when quit. The 'run script' command
performs a load-execute or compile-execute operation, depending on
whether the direct argument is a file spec or a string; it doesn't
store the new script object back to file afterwards.
Thanks for that elucidation, has.
Just to clarify this a step further - I take it that, by file spec,
you're referring to a file that is either a compiled script (file type:
"osas") or an applet (file type: "APPL"). It's my understanding that a
plain text file (normally file type: "TEXT") would be compiled before
execution - much as a string. In other words, when a script is already
saved in compiled form, it is not subsequently recompiled by 'run
script' - while uncompiled text is.
Two solutions to the 'how do I update the applet's stored state _and_
get a response back from the run event' problem:
[snip: solution 1]
This is the usual approach with compiled scripts though might be a
little rude for applets. There's a risk that this script replaces the
applet's script while the applet is running; when the applet quits it
will then overwrite these changes itself.
2. Save the applet as stay-open, allowing it to handle and reply to
incoming Apple events normally. This is simpler and a bit more polite
too.
Good point - and thoroughly reassuring to note that some young applets
are still being brought up to observe good manners! ;-)
---
kai
_______________________________________________
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