我正在爲一個Alfred工作流編寫腳本。但是,字符串比較永遠不會評估爲真。字符串比較在Alfred中永遠不會評估爲真
腳本內的"{query}"
確實會被替換,我可以正面使用display dialog "{query}"
和display dialog class of "{query}"
正確ctext
值類型。
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
逃逸@ jackjr300感謝您的意見。檢查轉義複選框後,評估仍然是錯誤的。 –