my UD_CheckBox_Filler(contents of default entry "UseLiveStyle" of user defaults, button "livestyle" of view of tab view item "friends list" of tab view "panes" of window "preferences")
on UD_CheckBox_Filler(prefsettings, theObject)
if prefsettings then
set x to 1
else
set x to 0
end if
set state of theObject to x
end UD_CheckBox_Filler
but now, it won’t work, it just gets an NSCannotCreateScriptCommandError (10) every time. It used to work, but now it seems to be having trouble putting the button in a variable and then reading it. Help? Please?
button "livestyle" of tab view item "friends list" of tab view "panes" of window "preferences"
Also, there is a quirk to working with tab views, where you’ll get an error when trying to manipulate the tab view item or any objects within it when it is not visible. If the tab view item “friends list” is not visible when you execute your code above, the part trying to set the button’s state will probably throw an error. If the code posted above doesn’t help, I’d then try commenting out the “set state of theObject to x” line and seeing if you still get an error.
To be honest, most of the problems I’ve had seem to be with objects that use data sources. I haven’t the interest to go through and discover all the limitations, but I know many people have had problems with data source objects (like table views and outline views), and also with trying to reference items that are in a tab view item that is not visible. There are usually workarounds, and I just thought I would mention it so if you ran into obstacles you’d have the benefit of knowing that it may not necessarily be something you’ve done that’s causing the problems.
Okay well switching the tab view seems to work for button states, but doesn’t seem to be required for text fields or sliders or popup buttons. Go figure.