I’d like to be able to have scripts send SMS and access the Dial bluetooth phone actions. These are only present on phone numbers if a bluetooth phone is connected (the B thing goes blue)
I had a look at the Address Book dictionary and started hard at perform action but didn’t make it sing. If you can think of how to access those menu items without GUI scripting then I’ll be happy
So I turned to GUI scripting. Using the Interface Browser from apple I got this almost working (replace James Howison with the name of a card in your address book):
This correctly pops up the menu with the actions in it but the second click line that actually tries to click the menu item doesn’t work and I get the dreaded, “System Events got an error: NSReceiverEvaluationScriptError: 4” which isn’t very helpful. Tried it with and without the delay line.
Clearly I’m accessing the menu item wrongly or something similar
tell application “Address Book”
set someones_ID to person “James Howison”'s id
end tell
open location “addressbook://” & someones_ID
activate application “Address Book”
tell application “System Events”
tell process “Address Book”
– GUI Scripting statements:
click pop up button “mobile” of scroll area 3 of splitter group 1 of window “Address Book”
delay 2
click menu item “SMS Message” of menu 1 of scroll area 3 of splitter group 1 of window “Address Book”
end tell
end tell
Any ideas (be they vanilla Applescript or GUI) much appreciated!