[Pythonmac-SIG] coercing to text (Adam Morris)

Adam Morris amorris at mistermorris.com
Tue Dec 15 12:49:08 CET 2009


ASTranslate tells me that
tell application "Pages" to tell front document to get selection as text
should be
app(u'Pages').documents[1].selection.get(resulttype=k.unicode_text)

but that doesn't return what I want (a reference? ... hardly useful!). Yet:

app('Pages').documents[1].selection()()

returns what I want. The unicode text.

I don't get what that 'extra' set of parens is doing. What implicit function
is being called? Can't imagine it's get().

I'm obviously missing something here, but no idea what! ASTranslate seems to
be missing it too. Thanks for your help!

-Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20091215/4540888a/attachment.htm>


More information about the Pythonmac-SIG mailing list