为什么使用 Applescript 库会阻止我 运行 shell 脚本?

Why is using an Applescript library preventing me from running a shell script?

所以我正在做一个项目,我需要 the AppleScript stdlib 的文本库中的多个函数。 所以我做了这样的事情:

use script "text"

-- Do some stuff with text

do shell script "echo hello"

然而,编译它会产生关于行尾预期方式的错误。

通过术语搜索 do、shell 和 script 没有结果。

有没有办法在一段时间后停止使用脚本而不将整个脚本包装在 tell 语句中,或者完全防止这种行为?

来自:问题

Compiling this, however, produces an error about how an end of line was expected.

use script "text"

之后添加use scripting additions

发件人:use (scripting additions)

Scripting addition commands are handled differently if a script has use commands. If a script has one or more use commands of any kind, scripting addition commands are not available by default. You must explicitly indicate that you wish to use scripting additions, either with a use or using terms from command

来自:问题

Is there either a way to stop using a script

您可以将其用作 using terms from script "text" ... end using terms from

看看:using terms from

Syntax

  using terms from ( application  |  script  | scripting additions) 
      [ statement ]... 
  end [ using terms from ]