views:

54

answers:

1

This seems like a straightforward operation but I am stumped.

How do you set value of current Numbers cell using Py-Appscript?

+1  A: 

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')
Ned Deily
Thanks again, Ned.
Chris Redford