set StatusSwitch to title of popup button "switch" --rather than
"contents"
if StatusSwitch = 0 then
set StatusSwitchtext to "item 1" -- etc.
hope that helps, Rob D
On Mar 27, 2005, at 2:48 PM, Stefan Eriksson wrote:
Hello !
I´m a complete newbie in ApplescriptStudio and is working on my first
interface in Interface builder, i managed to get the chosen item as a
number (the items are called "Item 1", "Item 2" and "Item 3") which
gives the values (0,1 or 2), but in what form is the (0,1 or 2), i
have tried integer/text/string and god knows what else... can anyone
help me how to extract the chosen selection as "Item 1" and so on...
Cheers, Stefan
Code so far:
on clicked theObject
set StatusSwitchText to "none"
tell window of theObject
set StatusSwitch to get contents of popup button "switch"
set StatusSwitch to StatusSwitch as text
if StatusSwitchText = "0" then
set StatusSwitchText to "Item 1"
if StatusSwitchText = "1" then
set StatusSwitchText to "Item 2"
if StatusSwitchText = "2" then
set StatusSwitchText to "Item 3"
else
set StatusSwitchText to "This doesn´t work at all"
end if
end if
end if
set contents of text field "StatusSwitch" to StatusSwitchText
end tell
end clicked
-- Created by Stefan Eriksson on Sun Mar 27 2005.
-- Copyright (c) 2003 __MyCompanyName__. All rights reserved.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list
(email@hidden)
Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-studio/
email@hidden