如何使用py-appscript
访问当前的数字表
对于后代,我使用此信息创建的程序将清除当前表中的所有单元格,并将所选内容返回到单元格A1
。我使用Automator中的python运行Shell脚本将其转换为服务,并将其附加到数字上
from appscript import *
Numbers = app('Numbers')
current_table = None
for sheet in Numbers.documents.first.sheets():
for table in sheet.tables():
if table.selection_range():
current_table = table
if current_table:
for cell in current_table.cells():
cell.value.set('')
current_table.selection_range.set(to=current_table.ranges[u'A1'])
它被用来清除我用来临时计算的大数字表
编辑:似乎没有对当前表的直接引用,但您似乎可以通过搜索当前第一个文档的工作表来查找具有非空选择范围的表,例如:
相关问题 更多 >
编程相关推荐