开发者

Removing icon for AppleScript script from dock

开发者 https://www.devze.com 2023-02-27 00:57 出处:网络
How can I hide the dock icon for a running AppleScript, and keep the application only in the menu ba开发者_如何学JAVAr?To hide an application from appearing in the dock, you need to modify the Info.pl

How can I hide the dock icon for a running AppleScript, and keep the application only in the menu ba开发者_如何学JAVAr?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消