在数字中设置选择(Python / Appscript)

时间:2009-11-07 21:28:17

标签: python iwork appscript

如何使用py-appscript

在Numbers中设置表格的选择

这似乎应该非常简单,但解决方案令人沮丧地回避。我可以得到当前的选择:

 current_table.selection_range

我可以得到它的细胞:

  current_table.selection_range.cells()

但是尝试set()他们中的任何一个都会生气appscript错误。

1 个答案:

答案 0 :(得分:3)

看起来像这样的东西:

>>> current_table.selection_range.set(to=current_table.ranges[u'B3:C10'])

注意,查看Number'sAppleScript Editor中的ASDictionary脚本字典,属性selection_range被定义为类range。所以这是一个线索,你需要提出类型range的引用来设置它。

相关问题