访问 iWork Numbers 中的单元格属性
我正在尝试访问 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 获取工作表和文档的指导。
干杯
伊恩
I'm trying a access the complete reference for a cell in Applescript. So far I've managed to get the cell reference and the table reference using a script like:
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
I can't seem to get the same structure to work for getting the sheet or the document reference. I have tried accessing the properties of the cell and I get something like:
{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}
The column property of a cell therefore seems to include the complete reference but if I access the reference directly through the column property.
Can anyone give me some guidance as to how I get the sheet and document using applescript.
Cheers
Ian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到了解决方案,相当简单,只要代码顺序正确即可:
可以使用类似的代码来检查文档编号
Found the solution, fairly simple as long as the code is in the right order:
Can use similar code to check for the document number