【问题标题】:AppleScript error: 'Expected "else", etc. but found unknown token'AppleScript 错误:'预期为“else”等,但发现未知令牌'
【发布时间】:2014-10-18 13:35:10
【问题描述】:

我是 AppleScript 的新手。编辑器没有给我语法高亮,所以我有点卡住这个错误。

set exportPath to path to documents folder as text

with timeout of (30 * 60) seconds 
    tell application "Evernote"
        repeat with nb in every notebook of application "Evernote"
            set theName to the name of nb
            set matches to find notes "notebook:" & "\"" & theName & "\""
            set f to exportPath & theName & ".enex"
            export matches to f
            if (count of matches) > 0 then 
                set p to POSIX path of f
                do shell script "/usr/bin/gzip -f " & quoted form of p
            end if
        end repeat 
    end tell
end timeout

当我在错误上单击“确定”时,光标位置将更改为最后 if 行的末尾。

【问题讨论】:

    标签: applescript


    【解决方案1】:

    end if 之前有一些奇怪的未知字符。

    取出该行并重新键入它会起作用。

    set exportPath to path to documents folder as text
    
    with timeout of (30 * 60) seconds 
    tell application "Evernote"
        repeat with nb in every notebook of application "Evernote"
            set theName to the name of nb
            set matches to find notes "notebook:" & "\"" & theName & "\""
            set f to exportPath & theName & ".enex"
            export matches to f
            if (count of matches) > 0 then 
                set p to POSIX path of f
                do shell script "/usr/bin/gzip -f " & quoted form of p
            end if
        end repeat 
    end tell
    end timeout
    

    【讨论】:

    • 当我这样做时,语法高亮再次开始工作!诡异的。谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-04-01
    • 2017-11-20
    • 2013-12-31
    • 1970-01-01
    • 2010-11-14
    • 2013-07-16
    • 2014-12-02
    相关资源
    最近更新 更多