【发布时间】:2021-11-20 09:53:23
【问题描述】:
on alfred_script(q)
tell application "Google Chrome"
if it is closed then
activate
end if
else
make new window
tell application "System Events" to set frontmost of process "Google Chrome" to true
activate
end else
end tell
end alfred_script
我的 appleScript 代码出了什么问题
如果谷歌浏览器已打开,我只想打开新终端,否则只需运行谷歌浏览器。
这将是一个阿尔弗雷德工作流程。
【问题讨论】:
-
if 和 else 嵌套不正确。
else应该在end if之前(可以删除),而不是end else使用end if。
标签: applescript alfred