【发布时间】:2009-11-07 19:01:52
【问题描述】:
如何使用 py-appscript 访问 Numbers 中的当前表格?
对于后代,我使用此信息创建的程序会清除当前表的所有单元格并将选择返回到单元格A1。我在 Automator 中使用 python Run Shell Script 将它变成了一项服务,并将其附加到 Numbers 中。
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'])
它用于清除我用于临时计算的大型数字表。
【问题讨论】:
标签: python iwork sourceforge-appscript py-appscript