Correct Syntax for matrix and popupbutton

Dear Folks,


on clicked theObject
	if name of theObject is "Connect" then
		--tell window "Window"
		set PopupButtonItem to title of current menu item of popup button "thePopUpButton1" of window "Window"
		set theMatrixItem to name of current cell of matrix "theMatrix1" of window "Window"
		--end tell
		
		-- Check Huawei E220 gprsinternet
		if (PopupButtonItem is "Web'n'walk Box compact") and (theMatrixItem is "HSDPA Internet") then
			tell application "Internet Connect"
				tell application "System Events" to set visible of process "Internet Connect" to false
				--activate
				set configName to "Huawei MOBILE"
				connect PPP configuration 1 to telephone number "gprsinternet"
				quit
			end tell
		end if
end clicked

The Problem of my script is, that it is not doing anything - normally this should dial the internet… Are there any problems with the matrix or the popupsyntax? The same syntax is working fine in facespan - I am now working with Xcode…

when I have the matrix within a tab view then the source should look like this - am I right?


set PopupButtonItem to title of current menu item of popup button "thePopUpButton1" of tab view item "connect" of tab view "tab" of window "Window"
		set theMatrixItem to name of current cell of matrix "theMatrix1" of tab view item "settings" of tab view "tab" of window "Window"

Thanks for your help…

Best regards,

Stefan

This is the correct syntax:


on clicked theObject
	if name of theObject is "Connect" then
		tell window id 1
			set PopupButtonItem to title of current menu item of popup button "thePopUpButton" of tab view item "Connection" of tab view "tab"
		end tell
		tell window id 1
			set theMatrixItem to title of current cell of matrix "theMatrix" of tab view item "Settings" of tab view "tab"
		end tell
end clicked

The Correct Syntax for the Matrix is “title” not “name”

Best Regards,

Stefan