Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 如何在应用程序包装器脚本启动后使dock图标停止反弹?_Macos_Shell_Zsh_Dock - Fatal编程技术网

Macos 如何在应用程序包装器脚本启动后使dock图标停止反弹?

Macos 如何在应用程序包装器脚本启动后使dock图标停止反弹?,macos,shell,zsh,dock,Macos,Shell,Zsh,Dock,因此,我最近为zsh脚本制作了一个.app包装器,但当我运行它时,应用程序的图标会一直在Dock中跳跃 该应用程序基本上是: % find Example.app -type f Example.app/Contents/Info.plist Example.app/Contents/MacOS/wrapper.sh % cat Example.app/Contents/Info.plist <?xml version="1.0" encoding="UTF-8"?> <!DO

因此,我最近为zsh脚本制作了一个
.app
包装器,但当我运行它时,应用程序的图标会一直在Dock中跳跃

该应用程序基本上是:

% find Example.app -type f
Example.app/Contents/Info.plist
Example.app/Contents/MacOS/wrapper.sh
% cat Example.app/Contents/Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
 <!-- tell OSX what the name of the executable is -->
 <key>CFBundleExecutable</key>
 <string>wrapper.sh</string>
</dict>
</plist>
% cat Example.app/Contents/MacOS/wrapper.sh
#!/usr/bin/env zsh
# not my real script, but something else that hangs for a while
sleep 10
%
%find Example.app-类型f
Example.app/Contents/Info.plist
Example.app/Contents/MacOS/wrapper.sh
%cat Example.app/Contents/Info.plist
Cbundlexecutable
wrapper.sh
%cat Example.app/Contents/MacOS/wrapper.sh
#!/usr/bin/env zsh
#不是我真正的剧本,而是其他一些暂时搁置的东西
睡眠10
%
你也可以

有没有办法让应用程序图标停止跳跃,像普通应用程序一样,坐在那里
旁边有个三角形?

你想要的。dock不能与类似的shell脚本一起工作,它需要一些更成熟的东西。

应用程序的图标将在OS X dock中反弹,直到应用程序进入其主事件循环并开始响应用户输入。由于您的脚本可能没有运行Carbon或Cocoa事件循环(请分别参阅Carbon event Manager和NSApplication的文档),Dock一直在等待,希望出现一个常规的前台GUI应用程序


我成功使用的脚本包装工具是。它可以在执行脚本时运行自己的事件循环,还可以执行许多其他方便的操作。

我认为如果将LSUIElement添加到Info.plist文件中,它应该可以工作。

DropScript的最新版本(0.5)似乎是一个仅限PPC的二进制文件。在英特尔Mac电脑上无法使用任何最新版本(我想是>10.5?)的OS X。