如何隐藏正在运行的 AppleScript 的停靠栏图标,并仅将应用程序保留在菜单栏中?
要隐藏应用程序使其不显示在 Dock 中,您需要修改应用程序内的 Info.plist 文件。最简单的方法是在 Finder 窗口中选择应用程序,按住 Control 单击,然后选择“显示包内容”。通过文本编辑器编辑 Info.plist。这基本上是一个 XML 文件。只需将其添加到字典中即可。
<key>LSUIElement</key>
<string>1</string>
这只会隐藏扩展坞中的应用程序图标。
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 https://stackoverflow.com/a/29217726/2694493 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.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)