In AppleScript if you want to show the Script Menu
in the menu bar you have to:
- Click Applications
- Scroll down and click Utilities
- Click Script Editor (this was called AppleScript Editor in older OS X
versions) - Click the “Script Editor” menu item, then click “Preferences…”
- On the Preferences dialog click “Show Script menu in menu bar”
- If it isn’t selected, you’ll want to enable the “Show Computer scripts”
option
but is there a file in system that I can target to activate this in a script? Trying to build an installer that will turn this on when if not active but I'm having issues trying to find where in the system I can hit this. Dont mind a do shell
but prefer not to use Automator.
Best Answer
10.13 (High Sierra) and before
If you do not want to have to go through Script Editor > Preferences > General to check the
[ ] Show Script menu in menu bar check box, then here is one way of enabling the Script Menu using AppleScript:
You could just use:
However, since System Events has a
script menu enabled
property, it makes sense to check whether or not it's enabled first. Either way though, opening the target file loads the Script Menu and checks the [√] Show Script menu in menu bar check box in: Script Editor > Preferences > GeneralAlso, from Terminal, you could just run:
Opening the target file in any manner shown accomplishes the goal.
By the way, when the Script Menu is enabled the target plist file is:
The key is a Boolean and is
NSStatusItem Visible com.apple.scriptmenu
, and will also have an element in themenuExtras
Array as aString
holding the pathname of the item.Note that the information above was gathered under macOS 10.13.5.
10.14 (Mojave) and up
The script menu has been upgraded into a full-fledged application, instead of a
.menu
file. It is now located at/System/Library/CoreServices/Script Menu.app
.To activate it on 10.14+, the terminal/shell command changes to: