Zettt / LaunchBar-Scripts

Scripts for LaunchBar, Alfred, Keyboard Maestro and more.
http://www.macosxscreencasts.com
165 stars 20 forks source link

LB6 Action: Execute menu command #16

Open Zettt opened 9 years ago

Zettt commented 9 years ago

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 commented 9 years ago
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