开发者

How to set value of current Numbers cell using Py-Appscript

This seems like a straightforward operation but I am stumped.

How do you set value of current Numbers cell using Py-Appsc开发者_JAVA技巧ript?


Pretty tediously, but working:

>>> from appscript import *
>>> app('Numbers').documents.first.sheets.first.tables.first.selection_range.cells.first.value.set(to=42)

That's assuming a simple document. More generally, you can select items by name:

>>> app('Numbers').documents['MyDocument.numbers'].sheets['MySheet'].tables['MyTable'].selection_range.cells.first.value.set(to='abc')
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜