我已经编写了一个 AppleScript 并希望将其转换为 osascript,以便我可以在启动时使用 launchd 运行它。有什么方法可以将其转换为 osascript 还是必须将整个脚本重写为 osascript?如果无法完成,是否至少有一种方法可以在终端中将其作为 osascript 运行?谢谢!
on idle
tell application "System Events" to ¬
if exists process "Launchpad" then run script
tell application "Launchpad"
delay 0
tell application "System Events" to keystroke "b" using {control down, option down, command down}
delay 0
tell application "System Events" to keystroke "b" using {control down, option down, command down}
delay 0
tell application "System Events" to keystroke "b" using {control down, option down, command down}
delay 0
end tell
end idle