Change properties in one applet from another
Change properties in one applet from another
- Subject: Change properties in one applet from another
- From: Gary Lists <email@hidden>
- Date: Mon, 13 Jan 2003 01:06:06 -0500
Hey now, listahs.
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
Script B
property x : missing value
on run
display dialog x
end run
to resetX()
set x to (display dialog ,
"Enter new value for X" default answer "")'s text returned
display dialog x
end resetX
When I run script A, script B's resetX() is called and my newly entered
value is displayed back to me with the handler's display dialog.
However, when I then double-click to run the script, the value of X is still
'missing value' in the run handler's display dialog.
========
As other examples, I've tried writing:
set pickAppRef's x to 12
and
tell pickAppRef to set it's x to 12
While I've come quite a long way in recent months with my scripting ability,
I've not ventured into this cross-script action, but I know that I must be
missing something simple. I have read past threads, as well as online
references regarding "calling handlers from another script", but I can't
seem to get it right in my head...or in my script.
Go easy on me if you can resist ;) and thanks for your advice.
AS 1.8.3 / OS 9.1.2
Thanks,
--
Gary
_______________________________________________
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.