AppleScript错误:'预期'其他“等等,但发现了未知令牌'

时间:2014-10-18 13:35:11

标签: applescript

我是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

当我在错误上单击“确定”时,如果将行光标位置更改为在结尾之前的行。

1 个答案:

答案 0 :(得分:0)

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