Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Studio Strangeness in 10.3



I've noticed a few strange things in Studio while developing in Panther:

1) Let's say that I have a box with a number of check boxes in it, and two buttons: "enableAllButton" and "disableAllButton". The code I use for these buttons is this:

on clicked theObject
if the name of theObject is equal to "enableAllButton" then
set the state of every button of box "trackPropertiesBox" of window "mainWin" to on state
else if the name of theObject is equal to "disableAllButton" then
set the state of every button of box "trackPropertiesBox" of window "mainWin" to off state
end if
end clicked

enableAllButton works fine -- all the check boxes in the box "trackPropertiesBox" are enabled (a check is placed in them). However, disableAllButton doesn't work. In fact, it does the exact same thing as enableAllButton! I tried starting a new project and placing all the buttons directly in the window (without the box), but I still get the same result. Additionally, setting the state of one button at a time (set the state of button 1...) shows the same behavior.

2) From the menu documentation, it looks like we can create a script object and associate it with a menu item. however, when I try this:
on updatePresetMenu()
script saveScript
(*on choose menu item theItem
display save panel attached to window "mainWin" in directory appSupport
end choose menu item*)
display dialog "This will be replaced with something real later."
end script
delete every menu item of menu of popup button "presetMenu" of window "mainWin"
set itemsOfAppSupport to do shell script "ls " & appSupport
repeat with x from 1 to (count paragraphs of itemsOfAppSupport)
make new menu item at end of menu items of menu of popup button "presetMenu" of window "mainWin" with properties {title:paragraph x of itemsOfAppSupport}
end repeat
set saveMenuItem to make new menu item at end of menu items of menu of popup button "presetMenu" of window "mainWin" with properties {title:"Save", name:"saveMenuItem"}
set script of saveMenuItem to saveScript
end updatePresetMenu

I get "NSReceiverEvaluationScriptError: 3 (1)" on running. Commenting out the "set script" gets rid of the error. The menu item saveMenuItem is added to the popup menu without a problem. (appSupport is a global, so it's not defined in this handler. I've confirmed that it's valid, though.)

3) Getting information about the current menu item in a popup button doesn't seem to work in an "on choose menu item" handler. I'd imagine that
on choose menu item theObject
log title of current menu item of theObject
end choose menu item

where theObject is a popup button would give me the title of the currently selected menu item. Instead, I get "NSReceiversCantHandleCommandScriptError (4)"


These three issues can be repeated on both of my machines. One is running 10.3.2 (these problems also occurred in 10.3.1 as well, I just upgraded) and the other Server 10.3.1, both using XCode 1.0.1.
All of this is very strange and I'm at a loss for what to do now. Any ideas? If others can confirm this, I'll file some bugs.

--
Chris Garaffa
email@hidden
http://moondrop.nilzero.com
_______________________________________________
applescript-studio mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-studio
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.