14

I was just answering another question and was reminded of a new "feature" in Mavericks.

I used to have a number of small Automator Services that took no input but did something useful when tied to a keystroke. The perfect example was one to bring the Terminal to the front. Some of these required selecting a menu item in the application brought to the front such as Bring All to Front.

Now it seems you need to grant "accessability" to every single app so that a universal keystroke will work if the Service uses the System Events AppleScript library.

Anyone know a fix for this?

  • 1
    The fact that Accessibility has to be authorized individually per-app is ridiculous. They need a setting much like the Allow applications feature. – l'L'l Jan 21 '14 at 9:12
  • 1
    Well, they need a way of authorising the 'System Events` AppleScript library that issues the command rather than the app that is running when you activate the service. But it is ridiculous. – Tony Williams Jan 21 '14 at 9:26
23

I don't know how to click menu items without using System Events, but if others get here searching for how to click menu items with System Events:

tell application "System Events" to tell process "Finder"
    click menu item "New Finder Window" of menu 1 of menu bar item "File" of menu bar 1
end tell
tell application "System Events" to tell process "Finder"
    set frontmost to true
    click (menu item 1 where its name starts with "Compress") of menu 1 of menu bar item "File" of menu bar 1
end tell
tell application "System Events" to tell process "Finder"
    set frontmost to true
    tell menu bar item "File" of menu bar 1
        click
        click menu item "Open With" of menu 1
    end tell
end tell

You can allow all currently installed applications to use the accessibility API by dragging them to the list in System Preferences:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .