Applescript 退出终端
Applescript to quit Terminal
背景:我是一名 Mac 用户,在 PostScript 中维护一个程序。后记由 Adobe Distiller 解释(“提炼”)。所以有时我想要第二次或第三次 Adobe Distiller。
为了打开这样的实例,我有一个名为“DistillerNewInstance.command”的小文本文件:
open -n -a "Acrobat Distiller"
osascript -e 'tell application "Terminal" to close first window'
osascript -e 'tell application "Terminal" toquit saving no'
Distiller 钻头工作得很好。幸福。
但是终端没有退出。它询问“您要终止此 window 中的 运行 进程吗?”。上面的某些变体关闭 window 但离开终端 运行。拜托,我的 .command 文件中有什么可以让终端安静地消失? (没有不安全地使用 killall。)
谢谢。
考虑执行 open
shell command directly via AppleScript using its do shell script
命令,而不是通过 终端 应用程序。
通过使用以下 AppleScript,无需关闭任何终端 windows 并退出。
repeat 3 times
do shell script "open -n -a" & space & quoted form of "Acrobat Distiller"
end repeat
上面给出的示例将启动 Acrobat Distiller 应用程序的三个实例。
背景:我是一名 Mac 用户,在 PostScript 中维护一个程序。后记由 Adobe Distiller 解释(“提炼”)。所以有时我想要第二次或第三次 Adobe Distiller。
为了打开这样的实例,我有一个名为“DistillerNewInstance.command”的小文本文件:
open -n -a "Acrobat Distiller"
osascript -e 'tell application "Terminal" to close first window'
osascript -e 'tell application "Terminal" toquit saving no'
Distiller 钻头工作得很好。幸福。
但是终端没有退出。它询问“您要终止此 window 中的 运行 进程吗?”。上面的某些变体关闭 window 但离开终端 运行。拜托,我的 .command 文件中有什么可以让终端安静地消失? (没有不安全地使用 killall。)
谢谢。
考虑执行 open
shell command directly via AppleScript using its do shell script
命令,而不是通过 终端 应用程序。
通过使用以下 AppleScript,无需关闭任何终端 windows 并退出。
repeat 3 times
do shell script "open -n -a" & space & quoted form of "Acrobat Distiller"
end repeat
上面给出的示例将启动 Acrobat Distiller 应用程序的三个实例。