How do you programmatically press a toolbar button using AppleScript?

I hope this is not too obvious, but I would like to press one of the toolbar buttons in the application using AppleScript.

Background: The button does not have a menu item or shortcut keys. Thus, I cannot activate it with any of these methods; I need to find the way AppleScript is actually a click away.

+3
source share
3 answers

I'll talk a bit about what @hced said.

, click button 3 of tool bar 1 of window 1 . OS OS thic . - iTunes. iTunes 10.5.8 17, 10.7.5 25. "AirPlay"!

Apple: http://developer.apple.com/library/mac/#samplecode/UIElementInspector/Introduction/Intro.html

, , , AppleScripts:

click (every button whose description is "AirPlay") of window "iTunes" of application process "iTunes"

, , , . , !

, ! Bo

+3

, , . , .

, :

tell application "System Events"
    tell process "OmniFocus"
        click (every button whose description is "Contexts") of tool bar 1 of window 1
    end tell
end tell

, - "" ( ), . , , ?

+2

, , , , . (Googling , Prefab UI Browser , , ).

:

tell application "System Events"
    tell process "OmniFocus"
        click button 3 of tool bar 1 of window 1
    end tell
end tell

:

How do you link to a toolbar button by name / description? I know that a button has a description attribute with the value: "Contexts". But then again, how can I refer to it in a click statement?

0
source

Source: https://habr.com/ru/post/1749566/


All Articles