加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

后台Shell作业后为什么Applescript不退出?

发布时间:2020-12-15 22:36:50 所属栏目:安全 来源:网络整理
导读:我可以创建一个(非常)简单的AppleScript应用来运行Firefox背景和放大器出口. (原因是我有不同的工作和家庭档案).我的脚本基本上是: do shell script “/Applications/firefox.app/Contents/MacOS/firefox -no-remote -P ‘Personal’ ” 它可以工作,但在退
我可以创建一个(非常)简单的AppleScript应用来运行Firefox背景和放大器出口. (原因是我有不同的工作和家庭档案).我的脚本基本上是:

do shell script
“/Applications/firefox.app/Contents/MacOS/firefox
-no-remote -P ‘Personal’ &”

它可以工作,但在退出Firefox之前,脚本/应用程序不会退出.我该如何解决这个问题?

解决方法

你需要在某处重定向stdout和stderr. do shell脚本命令知道它为程序的stdout和stderr设置的管道仍处于打开状态,因此等待它们关闭.

do shell script "/Applications/firefox.app/Contents/MacOS/firefox -no-remote -P 'Personal' > /dev/null 2>&1 &"

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读