我试图访问一个用于AppleScript的小区中的完整参考。到目前为止,我已经成功地得到了单元格引用,并使用脚本,如表引用:

tell application "Numbers"
tell document 1
repeat with i from 1 to count of sheets
tell sheet i
repeat with j from 1 to count of tables
tell table j
try
set currentCell to the first cell of the selection range
return name of currentCell
end try
end tell
end repeat
end tell
end repeat
end tell
end tell

我似乎无法得到同样的结构,以用于获取纸张或文件参考工作。我曾尝试接入小区的性质,我得到这样的:

{column:column "A" of table "Table 1" of sheet "Sheet 1" of document "Untitled" of
 application "Numbers", alignment:center, value:0.0, background color:{59111, 59111, 
59111}, text color:{0, 0, 0}, font size:10.0, vertical alignment:top, name:"A1",
 class:cell, font name:"HelveticaNeue", format:automatic, row:row "1" of table "Table
 1" of sheet "Sheet 1" of document "Untitled" of application "Numbers", text 
wrap:true}

一个单元格的列属性因此似乎包括完整的参考,但如果我直接通过柱属性访问参考。 谁能给我一些指导,我怎么得到表和文档使用AppleScript。

干杯

伊恩

有帮助吗?

解决方案

找到该溶液中,相当简单的,只要该代码是按照正确的顺序:

tell application "Numbers"
tell document 1
    repeat with i from 1 to count of sheets
        tell sheet i
            repeat with j from 1 to count of tables
                try
                    tell table j
                        set currentCell to the first cell of the selection range
                        set therow to row of currentCell
                        set sheetNumber to i
                    end tell
                end try
            end repeat
        end tell
    end repeat
    return name of sheet sheetNumber
end tell
end tell

可以使用类似的代码来检查文档编号

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top