Chris Redford
Chris Redford

Reputation: 17778

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-Appscript?

Upvotes: 0

Views: 424

Answers (1)

Ned Deily
Ned Deily

Reputation: 85045

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')

Upvotes: 2

Related Questions