开发者

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

开发者 https://www.devze.com 2022-12-16 16:29 出处:网络
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:

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

精彩评论

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