GUI Scripting to do file selection for upload prompt

hi all

im working on a non scriptable application
ive got it done about 90% now but at the final part im required to upload a file back to the server
however im not sure how to select the file in the prompt window so that i can press the choose button

Path of UIbrowser to the file i need shows this

dialog “Upload” (window 1)
group (group 1)
split group (splitter group 1)
browser (browser 1)
scroll area (scroll area 1)
scroll area (scroll area 1)
list (list 1)
text (static text 10)


tell application "System Events"
	activate
	set UI elements enabled to true
	--return UI elements enabled
	set frontmost of application process "xx" to true
	tell process "xx"
		tell window 1
			delay 0.5
			click button "Upload"
		end tell
		delay 2
		tell static text 10 of list 1 of scroll area 1 of scroll area 1 of browser 1 of splitter group 1 of group 1 of window "Upload"
			activate
			click  -- neither click nor select works
			select  
		end tell
	end tell
end tell

thanks in advance for any help

Model: Macbook Pro
AppleScript: 2.2.1
Browser: Safari 531.21.10
Operating System: Mac OS X (10.5)

Hi,

activate is a basic command and brings application to the front. For UI elements it’s useless.
System Events cannot select text in any UI element with the select command
You can get or set text in a text field with its value property