Capturing text field to variable with GUI scripting

Hi all!

I need to capture the AXValue of the text field shown below in UI Inspector to insert into a URL later in the script.


<AXApplication: “VLC”>
<AXWindow: “Properties”>

Attributes:
AXRole: “AXTextField”
AXRoleDescription: “text field”
AXHelp: “(null)”
AXValue (W): “391236”

The code I’m trying won’t wash - I can’t seem to get at the goodies in the “properties” window I opened. ‘get every ui element’ complains about type reference…


tell application "VLC"
	activate
end tell
set urlPart to "text"
tell application "System Events"
	tell process "VLC"
		tell menu bar 1
			tell menu bar item "Window"
				tell menu "Window"
					click menu item 6
					
					
					
				end tell
			end tell
			
		end tell
		tell window "Properties" of application process "VLC"
			
			get every UI element
		end tell
		
	end tell
end tell

How do I identify the ‘number’ of the text field using UI inspector?

I’m one heck of a newbie with applescript (but i know perl, python, php, etc…) so any help will be greatly appreciated…

Many thanks in advance,

Rich

Model: Mac Mini
Browser: Firefox 1.5
Operating System: Mac OS X (10.4)

I can’t test this, Rich - but, since you’re already in an application “System Events”/process “VLC” tell block, your reference to window “Properties” of application process “VLC” may well be confusing matters. Try shortening the line:

tell window "Properties" of application process "VLC"

… to:

tell window "Properties"

This worked:

tell application "VLC"
	activate
end tell
set urlPart to "text"
tell application "System Events"
	tell process "VLC"
		tell menu bar 1
			tell menu bar item "Window"
				tell menu "Window"
					click menu item 6
				end tell
			end tell
		end tell
		tell window "Properties" of application process "VLC" of application "System Events"
			tell group 1
				set urlPart to value of text field 2
				get urlPart
			end tell
			get every UI element
			click button 1 of window "Properties" of application process "VLC" of application "System Events"
		end tell
	end tell
end tell

Thanks fellas - “get every UI element” is a dream for debugging