gpt4 book ai didi

applescript oneliner

转载 作者:行者123 更新时间:2023-12-05 08:19:22 26 4
gpt4 key购买 nike

是否可以将 applescript 行合并为一个(在 ruby​​ 中可以使用 ; 完成)?

最佳答案

不是真的。最多可以做的是将一个简单的 if-then 语句放在一行中......

if (variable) then 
return true
end if

...成为...

if (variable) then return true

如果要在 shell 脚本中包含 osascript 命令,则多行脚本必须用 -e 分隔...

osascript -e 'if (variable) then' -e 'return true' -e 'end if'

但这就是它的范围。 Applescript 文件不像大多数其他编程语言那样是简单的文本文件(不幸的是),我们必须依靠其专门的编辑器来进行行管理。

关于applescript oneliner,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4108808/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com