…more in the line of basic AS Studio functionality.
I am starting to understand a little how Applescript and AS Studio interact. However, I continue to stumble over a series of basic symatics. So far you folks have all been a HUGE help and I am once again turning to you.
I have the code show below. I am creating properties to hold not only the popup button, but also its menu object. Then, later on, I am setting those objects and trying to access them via code. You can see where my code is failing by reading the comments. Of course, I have a simple work-around but I really want to learn this stuff so…
anyone have any ideas as to why the third way of adding to the menu items of the popup button is failing?
Thanks again!
Ben
property popShow : popup button
property mnuShow : menu
on awake from nib theObject
set popShow to popup button "popShow" of window "frmMain"
set mnuShow to menu of popShow
--this works
delete every menu item of mnuShow
--these work
make new menu item at the end of menu items of menu of popup button "popShow" of window "frmMain" with properties {title:"cn", enabled:true}
make new menu item at the end of menu items of menu of popShow with properties {title:"bb", enabled:false}
--this fails with an error of NSContainerSpecifierError(3)
make new menu item at the end of menu items of mnuShow with properties {title:"--", enabled:false}
end awake from nib