2
votes

How can I hide the dock icon for a running AppleScript, and keep the application only in the menu bar?

1
can you describe for me that you are calling "taskbar'mcgrailm

1 Answers

2
votes

To hide an application from appearing in the dock, you need to modify the Info.plist file inside the application. The easiest way to do this is to select the application in the Finder window, control‑click, then select "Show Package Contents". Edit the Info.plist via a text editor. This is basically an XML file. Just add this to the dict.

    <key>LSUIElement</key>
    <string>1</string>

This will only hide the application icon in the dock.

To have your AppleScript appear in the menu bar requires some additional coding. To add a menu bar item for your script, take a look at this answer which gives an excellent example. It will depend on your use case, but you will likely need to set your script to stay open. To do this, open your script in script editor, go to "File", hold the option key, select "Save as", then tick the "Stay open after run handler" checkbox.