LaunchBar-Scripts icon indicating copy to clipboard operation
LaunchBar-Scripts copied to clipboard

LB6 Action: Execute menu command

Open Zettt opened this issue 10 years ago • 1 comments

LB Action that reads all menu items of the front app and displays them as list. The user can then search for a command and execute it.

Zettt avatar Feb 16 '15 07:02 Zettt

tell application "Safari" to activate

tell application "System Events"
    tell process "Safari"
        set developMenu to menu bar item "Develop" of menu bar 1
        set allUIElements to entire contents of developMenu
        repeat with anElement in allUIElements
            try
                if name of anElement is "Show Web Inspector" then
                    click anElement
                    exit repeat
                end if
            end try
        end repeat
    end tell
end tell

Zettt avatar Feb 16 '15 07:02 Zettt