【发布时间】:2018-11-02 06:31:24
【问题描述】:
我正在使用苹果脚本关闭活动文档,如下所示
tell application "Microsoft Word"
activate
try
if not (exists active document) then error number -128
close active document saving yes
on error
end try
end tell
想要使用 shell 脚本执行类似的操作。我想优雅地关闭它并且不想使用 kill 命令。而且我不想使用 osascript 来调用苹果脚本。我想要一种使用本机 shell 命令的优雅方式
【问题讨论】:
标签: macos shell applescript macos-mojave