Scripting UI and Double Click

I’ve searched the forums, but I can’t seem to find an answer to this:

I’m in the process of writing a script which would automatically cerate a jpeg with the text that is parsed from a text file. The program that I’m using for this is LiveQuartz, which doesn’t have any applescript support. Using UI Scripting I can’t seem to insert the text I want into the textfield. If, however, I double click the textfield, then run the script it does insert the text.

Is there a way that I can scipt a “double click”?

Here is the code I was trying to use:

tell application “System Events”
tell process “LiveQuartz Image Editor”
activate
set s to “test”
tell row 1 of table 1 of scroll area 1 of window 1
set value of text field 1 to s
end tell
end tell
end tell

Any help is appreciated.

Tim

I’m afraid these things don’t always work in a very obvious way, Tim. Try something like this:

tell application "System Events" to tell process "LiveQuartz Image Editor"
	set frontmost to true
	tell text field 1 of row 1 of table 1 of scroll area 1 of window 1
		set value of attribute "AXFocused" to true
		keystroke "test"
	end tell
end tell

Thanks very much for the help - it worked like a charm. I’ve got a lot more to learn about Applescript.

Tim