Re: How do I set script property in another script?
Re: How do I set script property in another script?
- Subject: Re: How do I set script property in another script?
- From: "Bob.Kalbaugh" <email@hidden>
- Date: Thu, 02 Aug 2001 22:48:27 -0500
on 8/2/01 5:12 PM, John Jones at email@hidden wrote:
>
Hello all,
>
>
This has me stumped ....
John,
Try messing around with this. It should give you an idea of what you'll need
to do. The example below will be "Script B." Run this script a few times and
note the results. "Leave script A" as is.
-- watch the word wraps! and test on copies (just in case)
set MyObject to load script file "Floyd:Desktop Folder:test app"
display dialog "myNumber is now: " & (myNumber of MyObject)
set myNumber of MyObject to random number 20
set MyObject to MyObject as script
store script MyObject in file ("Floyd:Desktop Folder:test app") replacing
yes
Hope this helps!
bob.kalbaugh
>
This has me stumped and none of the references I can find
>
has cleared it up. I've got "Script A" that is saved as an
>
application with a property:
>
>
property myNumber : "5"
>
>
"Script B" loads "Script A" into a variable and can get the
>
propety just fine:
>
>
load script "Floyd:Desktop Folder:test app"
>
set MyObject to result
>
get myNumber of MyObject
>
>
But when I try to set the property to a new value either
>
by...
>
>
set myNumber of MyObject to 20
>
>
or by
>
>
tell MyObject
>
set myNumber to 20
>
end tell
>
>
It sets the property in the MyObject script object, and not
>
in the original. (I at least understand that this is a copy
>
of the original!) So how can I actually set the value in the
>
original?
>
>
Thanks,
>
>
John J.
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users