【发布时间】:2015-09-25 13:56:37
【问题描述】:
我正在为 Alfred 工作流程编写脚本。但是,字符串比较永远不会评估为真。
脚本中的"{query}" 确实被替换为正确的ctext 值类型,我可以使用display dialog "{query}" 和display dialog class of "{query}" 来反对。
if "{query}" is equal to "a" then
say "in the a case"
else
say "in the else case"
end if
我也尝试过使用if "{query}" = "a" then,但结果仍然相同。
评估不断落入else声明。
我在写条件语句的时候指的是下面的文章。
http://computers.tutsplus.com/tutorials/if-and-if-else-applescript-conditional-statements--mac-45590
【问题讨论】:
-
选中“双引号”和“反斜杠”复选框为AppleScript设置转义
-
@jackjr300 感谢您的 cmets。检查转义复选框后,评估仍然是错误的。
标签: applescript alfred