Hello
my first post in this list...so hello to everyone and thanks for
taking a look into this post.
i am working on a small AppleScript application. I am using XCode and
the Droplet template.
At the moment i am working on the preference dialog of my application.
The Preference window is a usual window named "myWindow" in
applescript.
My nsbutton checkbox on that window is "checkBoxStatistics" in
applescript
while launching my application i am reading the values of my .plist
file to set the UI-elements of the preference window according to the
stored values.
basicaly i can read those values from the plist, but i cant set the
state of my NSbutton checkbox.
I have tested this code:
-----------
on launched
-- some code
--
-- Here i want to change the status of a checkbox -> NSbutton
-- where:
-- myWindow is the As name of the window (not displayed at this
moment)
-- checkBoxStatistics is the AS name of my NSbutton checkbox
-- i have tried:
if myVAR is false then
-- idea 1:
set integer value of button "checkBoxStatistics" to 0
-- idea 2:
set string value of button "checkBoxStatistics" to "0"
-- idea 3:
tell window "myWindow" to set state of button "checkBoxStatistics" to
0
end if
end launched
-----------
ok i have tested many other combinations but without luck.
Is it possible in general to change the state of a NSbutton (i call it
checkbox) within applescript ?
If yes is it limited in i.e. that the window itself has to be
displayed while running the change-code ?
Is there something like re-init command, to get the ui restarted/
reloaded ?
Wondering what i am doing wrong right now.
Any ideas / suggestions ?
Best regards
florian