[Pythonmac-SIG] get reference
Zhi Peng
zhiyong_peng2003 at yahoo.com
Wed Oct 26 20:12:12 CEST 2005
Yes. When I run TextEdit, it works with following code
from appscript import *
textedit=app('TextEdit')
textedit.activate()
textedit.documents.end.make(new=k.document)
textedit.documents[1].text.set("TEXT STRING")
print textedit.documents[1].text.get()
It works well. But with app('Adobe InDesign CS2'), it
does not work well. All application can accept the
commands but not the reference such as
cs = app("Adobe InDesign CS2")
cs.activate() ----------------- works
cs.open("filepath_with_name") ------- works
doc = cs.documents[0] -------- works
page = doc[1] -------- works
textframe=page.textframes[1] ------- works
textframe.contents.set("HELLO") ------ not work
textframe.contents="HELLO" ------ not work
textframe.contents.get() ------ not work
contents is a property of textframe with r/w
I wonder if I missed something since I get only a
small __init__.py file while I used pythonw
getsuitmodule.py for Adobe InDesign CS2. But same
command applied to TextEdit and Finder, iTune, I get a
few big file include __init__.py.
--- has <hengist.podd at virgin.net> wrote:
> Zhi Peng wrote:
>
> >page = app("Adobe InDesign
> >CS2").open("filename").pages[0]
> >
> >This 'page' is not a reference,
>
> It is, although it's an invalid one as elements must
> be 1-indexed, not 0-indexed.
>
> has
> --
> http://freespace.virgin.net/hamish.sanderson/
> _______________________________________________
> Pythonmac-SIG maillist - Pythonmac-SIG at python.org
>
http://mail.python.org/mailman/listinfo/pythonmac-sig
>
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
More information about the Pythonmac-SIG
mailing list