PopUp Button Question

hi everyone,

here is the thing. i have a pop up button with the name “pubVersion.” i have two items innit which are named “Version 1.1” and “Version 1.2.” The have the applescript names of “pubi1dot1” and “pubi1dot2.”

i now have a script that sets a path to a file. depending, on if they selected version 1.1 or version 1.2, the location varies. how would i do such a thing? in other words, how would i get the current selected version?

again, my “inveted” applescript:


if chosen pop up button item is "pubi1dot1" then
set xyz to "xyz"
else if chosen pop up button item is "pubi1dot2" then
set xyz to "zyx"
end if

thanks

max

Hi Max,

please RTFDictionary :wink:

“current” is the keyword
something like this

on choose menu item theObject
	if name of theObject is "pubVersion" then
		if title of current menu item of theObject is "Version 1.1" then
			set xyz to "xyz"
		else -- if there are only 2 menu items
			set xyz to "zyx"
		end if
	end if
end choose menu item

Note: with this method it’s not necessary to specify the AppleScript names of the menu items

oka ygreat let me try it