首页 > 解决方案 > AppleScript - 语法错误:预期的行尾但找到“””

问题描述

我是 AppleScript 的初学者,我正在尝试编写一个脚本,该脚本将直接从 Numbers 表中将数据写入列表。

所以我编写了这个函数:

on readTableABC(sheetName)
    set readTable to {}
    
    tell table "Table 1" of sheetName 
        set rowCellCount to count of cells of column "A"
        tell column "B"
            repeat with i from 2 to rowCellCount
                set the end of readTable to value of cell i
            end repeat
        end tell
    end tell
    
    return readTable
end readTableABC

sheetName 实际上将采用 Numbers 文件的工作表名称。

当我编译时,我得到一个错误,上面写着:

语法错误:预期的行尾但找到了 """ 。

并且光标显示这个字符:[编译器指出的字符][1][1]:https://i.stack.imgur.com/VUqxa.png

你知道错误在哪里吗?

非常感谢你的帮助。尼古拉斯

标签: applescript

解决方案


正如 red_menace 所述:为了使用 Numbers 应用程序中的脚本术语,它们需要包含在告诉应用程序“Numbers”语句中,或者需要声明使用应用程序“Numbers”语句。


推荐阅读