[Pythonmac-SIG] deconstruct a py-appscript reference

Mark Sanvitale msanvitale at real.com
Fri Dec 11 22:57:32 CET 2009


I am new to both python and to appscript (I took up both at the same time).  I am curious about what I think is an internal detail of the appscript module and its classes.  Given my newbie status, I apologize in advance if my terminology for appscript things strays from the standard.

I have a reference returned by calling get() on some other reference (e.g. asking an iphoto album for its child list).  The reference I get back is fully resolved to a unique item (i.e. of the form app(u'/Applications/iPhoto.app').albums.ID(4294967326) and not involving a by-name lookup or query).  Now, I can use the returned reference to get() its properties, however, if the property I am after is "id" then it would be wasteful (i.e. extra IPC) to perform a get() for the id property because I can see it is a component of the reference I already have.

Thus, my question is how can I get the id directly out of such a reference?  Presumably, via some means more elegant than parsing a string version of the reference.  (So far, I have gotten as far as poking around myRef.AS_appdata and myRef.AS_aemreference but have not yet found the magic word.)

Thanks.

Mark Sanvitale


More information about the Pythonmac-SIG mailing list