Skip to content

Instantly share code, notes, and snippets.

@gregnewman
Forked from tswicegood/gist:372625
Created May 3, 2010 12:34
Show Gist options
  • Save gregnewman/388047 to your computer and use it in GitHub Desktop.
Save gregnewman/388047 to your computer and use it in GitHub Desktop.
>>> import appscript
>>> things = appscript.app("Things")
>>> things.lists.get()
[app(u'/Applications/Things.app').lists.ID(u'FocusInbox'),
app(u'/Applications/Things.app').lists.ID(u'FocusToday'),
app(u'/Applications/Things.app').lists.ID(u'FocusNextActions'),
app(u'/Applications/Things.app').lists.ID(u'FocusTickler'),
app(u'/Applications/Things.app').lists.ID(u'FocusMaybe'),
app(u'/Applications/Things.app').lists.ID(u'FocusActivityLevel-1'),
app(u'/Applications/Things.app').lists.ID(u'FocusLogbook'),
app(u'/Applications/Things.app').lists.ID(u'FocusTrash'),
app(u'/Applications/Things.app').areas.ID(u'A84051AD-9A40-42EE-9D11-D870379EA2CA'),
app(u'/Applications/Things.app').areas.ID(u'138236F3-3F80-4BCD-A6FD-518EFAC05B7E'),
app(u'/Applications/Things.app').areas.ID(u'B4426F9B-6B98-4D32-B88F-173FC3AC40D2'),
app(u'/Applications/Things.app').areas.ID(u'4E6FFBDF-9556-475F-A406-DC747758CE30'),
app(u'/Applications/Things.app').people.ID(u'B30283A3-FE59-406E-BC3E-F7230A247F73'),
app(u'/Applications/Things.app').people.ID(u'0AF3A227-B89A-4805-80CB-FF68347C2E6E')]
>>> things.lists.get()[2]
app(u'/Applications/Things.app').lists.ID(u'FocusNextActions')
>>> things.lists.get()[2].name.get()
u'Next'
>>> things.lists.get()[2].to_dos.get()[0].name.get()
u'Post gists of interacting with Things via appscript'
>>> todo = things.lists.get()[2].to_dos.get()[0]
>>> todo.status.get()
k.open
>>> todo.project.get()
k.missing_value
>>> todo.area.get()
k.missing_value
>>> todo.tags.get()
[app(u'/Applications/Things.app').tags.ID(u'1D91F0FF-147F-4845-902D-F643316252EE')]
>>> todo.tags.get()[0].name.get()
u'coding'
>>> todo.status.set(appscript.k.completed)
>>> todo.status.get()
k.completed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment