having a problem trying to access a menu bar item in Internet Connect.
I don’t know if it is because Internet Connect’s menu is largely non-Applescript friendly, or if I’m simply not using the correct hierarchy…
I am running Tiger 10.4.7 and here’s the script, Johnny:
tell application "Internet Connect"
activate
tell application "System Events"
click menu item "Import Configurations..." of menu "File" of menu bar item "File" of menu bar 1 of process "Internet Connect"
end tell
end tell
I’m told this is the correct hierarchy for Tiger and will not be applicable in previous OS X versions, but I may be wrong…
Can someone with vast guru amounts of Applescript knowledge (or more than me at any rate) shed some light on this?
Make it so!
Kind & warm regards from planet Orange.
Model: Dual 1 Ghz PowerPC G4
AppleScript: 1.10.7
Browser: Firefox 1.5.0.4
Operating System: Mac OS X (10.4)
tell application "Internet Connect"
activate
tell application "System Events"
tell process "Internet Connect" to click menu item 6 of menu "File" of menu bar 1
end tell
end tell
You could also check that the three dots at the end of “Import Configurations.” are the single character (ASCII number 201) produced on English-language keyboards with the key combination option-; Menu items that end in “.” usually have this character rather than three full stops in a row.
In GUI scripting, it’s a good idea to make sure that the process in which you want to ‘click’ is frontmost.
tell application "Internet Connect" to activate
tell application "System Events"
tell application process "Internet Connect"
set frontmost to true
click menu item "Import Configurations." of menu "File" of menu bar item "File" of menu bar 1
end tell
end tell