如何在包含引号的applescript中获取字符串

How to get a string in applescript that contains a quote

我想要一个包含引号的字符串。所以代码看起来像这样:return "hello"world" 它应该 return hello"world。在其他编程语言中,您可以转义引号或使用其他引号,但在 Applescript 中似乎都不起作用。

测试这两行代码:

set foo to "Hello\"World"
display alert foo

您将看到 fooHello"World 的实际值,与 return foo 的对比显示:"Hello\"World"

您会看到 双引号return 语句 中转义,因为通常会收到 foo,在这种情况下,将从中删除 \