Re: Change properties in one applet from another
Re: Change properties in one applet from another
- Subject: Re: Change properties in one applet from another
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 12 Jan 2003 23:03:17 -0800
On 1/12/03 10:06 PM, "Gary Lists" <email@hidden> wrote:
>
I feel like I should have been able to figure this out already, especially
>
given some of the recent references to one script manipulating values in
>
another. However, I can not seem to get things working after re-reading from
>
the archive and from several online samples.
>
>
I've been able to call another script's handler, but the values are not
>
"sticking".
>
>
=======
>
A simplified example (without any error trapping) where I've just been
>
trying to set script B's property X to some number...
>
>
Script A
>
on run
>
set pickApp to (choose file of type "APPL" with prompt "Where is it?")
>
set pickAppRef to load script pickApp
>
tell pickAppRef to resetX()
>
end run
on run
set pickApp to (choose file of type "APPL" with prompt "Where is it?")
set pickAppRef to load script pickApp
tell pickAppRef to resetX()
store script pickAppRef in pickApp replacing yes
end run
-- I suggest 'appScript' as variable name rather than 'pickAppRef '. It's
not a reference to the script file B - it's a script object, the script B
itself. It's called, modified, and perhaps run (not here) in script A in
memory only: 'store script replacing yes' is what saves it on disk "for
real".
--
Paul Berkowitz
_______________________________________________
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.