我正在尝试生成一个基于 Applescript 的 shell 命令,该命令告诉 Mac OS X 中的预览应用程序关闭特定窗口。
#!/bin/sh
osascript <<EOF
tell application "Preview"
close "$1"
end tell
EOF
Run Code Online (Sandbox Code Playgroud)
但这不起作用:我收到错误消息
25:52: execution error: Preview got an error: "musixdoc.pdf" doesn’t understand the close message. (-1708)
Run Code Online (Sandbox Code Playgroud)