Adam Morris wrote:
>In Applescript, I would write the following:

> tell app "Pages" to tell front document to get its selection  -- text from
>      character x to character y

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

or just

>>> app('Pages').documents[1].selection()
app(u"/Applications/iWork 
'09/Pages.app").documents.ID(13779112).body_text.text[app.documents.ID(13
779112).body_text.characters[95]:app.documents.ID(13779112).body_text.cha
racters[1681]]

>tell app "Pages" to tell front document to get its selection as text  --
> "whatever is selected"

>>> app('Pages').documents[1].selection()()
u'Lorem ipsum dolor sit amet, [...]'

(Tested with Pages '09 and appscript 0.21)

-- 
 Ned Deily,
 n...@acm.org

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to