GUI Scripting the address book

G’day guys,

I’m trying to figure out how to send an SMS message using applescript, address book and a bluetooth enabled mobile phone.

I’ve been attempting to use UIElementInspector ( http://www.apple.com/applescript/uiscripting/index.html ) to determine the hierarchy of what is going on, but all references to similar examples are referencing actual menu items.

The element i’m targeting is the “mobile” menu of a contact (must have bluetooth enabled), and not an actual menu item (more like a context menu (actionContext)).

Can anyone point me in a direction that would help me target the selection of the mobile element of a particular contact?

===============================

tell application “Address Book”
activate
end tell

tell application “System Events”
tell process “Address Book”
tell menu “mobile”
–tell menu “actionContext”

		--click menu item "SMS Message" 
		--end tell
	end tell
end tell

end tell

===============================

TIA

enjoi
mark

this might help you :

tell application "Address Book"
	activate
end tell

tell application "System Events"
	tell process "Address Book"
		tell window 1
			tell splitter group 1
				tell scroll area 3
					tell pop up button "mobile"
						click
					end tell					
				end tell
			end tell
		end tell
		
	end tell
end tell

Hey bigkm,

Thanks for the quick reply…

But i’m getting a NSReceiverEvaluationScriptError: 4 error - i’m assuming it’s because clicking the mobile button is not much use (sorry, should have been more specific).

how can i target one of the mobile menu items.

click menu item “SMS Message” → does not work…

TIA - virtual Crown larger heading your way.
:slight_smile:

enjoi
mark