How to applescript GUI elements that don't appear in the UI Browser

Hi all,

I am trying to applescript GUI element that does not appear in the UI Browser.

All it shows is

application “BlueMIDI”
standard window 1

it doesn’t allow me to be more specific and select elements in the window.

The window is very similar to the one used for “Bluetooth File Exchange” which gives me many options in the UI Browser.

How can i applescript actions on these buttons and text areas?

Can you script coordinate clicks… i.e. click 238x , 439, y hmm seems like the only way…

all suggestions will be very much appreciatied!

thanks!

Tim

Model: iMac (intel)
AppleScript: Latest
Browser: Firefox 1.5.0.7
Operating System: Mac OS X (10.4)

Hello

This short code may be a starting point:

tell application "BlueMidi" to activate
tell application "System Events"
	tell process "BlueMidi"
	tell window 1
		get properties of every UI elements
	end tell	
	end tell
end tell

If it works, you will be able to grab the list of properties in the log report.

Yvan KOENIG (from FRANCE jeudi 5 octobre 2006 16:43:28)

Hi Yvan,

Thanks for the reply!

Unfortunately this is what i get in log window!

tell application "BlueMIDI"
	activate
end tell
tell application "System Events"
	get properties of every UI element of window 1 of process "BlueMIDI"
		{}
end tell

Any ideas?

I am thinking the only way to do this is to do coordinate clicking given that the window always opens in the same spot.

how do I say

Click at this position and then click at this position?

Can I do it?

Thanks

Tim

Moving the mouse around is possible with XTool (an osax in http://osaxen.com/) and with Extra Suites (same place) to move the mouse, but while both have mouse click capability, neither have worked for me inside a window - they work on the close, minimize and maximize buttons, but not, for example to select a word by double clicking it or in some tool bars.

Try one or the other - they might work with your app.

Cheers, i will try it out.

Is there any reason the app has no GUI information. Should I hassel the developers of the app to fix it.

Is it ‘lazy’ programming or just a quirk of os x?

tim

I don’t know; Sorry.

Hello

Apple never forces the developper to make GUI scriptable applications.

They just gave them the way to do this kind of thing.

Apple itself doesn’ give the example. MOst of the dialogs available in AppleWorks don’t respond correctly to UI scripting. Many buttons blink when triggered but the wanted action doesn’t take effect.

Yvan KOENIG (from FRANCE vendredi 6 octobre 2006 07:29:30)

Ha!

that’s incrediable… computer software can be so sketchy at times… I love what you can do with Apple Script but it seems it’s not everything i thought it would be…

well if anyone has any ideas on how i could automate this thing… i only need to click two spots on the screen… could you do it in the terminal or something like it? way out of my leage but if it is an option then…

Thanks everyone for your help! Very much appreciated!

Tim

Hello

With this kind of code:

set theApp to "AppleWorks 6" --"BlueMIDI"
tell application theApp
	activate
end tell
tell application "System Events"
	get properties of every window of process theApp
	get properties of every window of process theApp whose subrole is "AXStandardWindow"
	get {name, position, size} of (every window of process theApp whose subrole is "AXStandardWindow")
	
end tell

We may grab useful infos.

Knowing the name, position and size of a window, we may compute the absolute position {xA, yA} of an object embedded in this window and so try to issue a

click at {xA, yA} command.

I can’t guarantee that the app will “take care” of this click but “no test” equals “no result”.

Yvan KOENIG (from FRANCE vendredi 6 octobre 2006 08:16:19)