Article View: adobe.scripting.indesign
Article #19307Re: How to select an inline graphic?
From: Olav Kvern
Date: Fri, 20 Dec 2002 19:25
Date: Fri, 20 Dec 2002 19:25
24 lines
2135 bytes
2135 bytes
Ann--
We don't need to select objects because scripting doesn't manipulate objects and properties by using the user interface. Instead, we work directly on objects in the document database. There are only a few cases where we actually need to select objects--for cut, copy, and paste into operations, for example.
As far as getting object references--a document has a hierarchy of objects, and each object has a place in the chain of parent-child relationships from the application object itself down to a single character in text or point on a path. There are usually multiple ways to get to an object.
A great way to find out where an object is is to use Visual Basic's debugging tools. Take a simple script:
Dim myInDesign as InDesign.Application
Set myInDesign = CreateObject("InDesign.Application.2.0")
Set myDocument = ActiveDocument
Put a Stop on the last line. Open a document in InDesign and press F5 to run the program--it'll stop at the line you marked. Next, press F8 to step through the line. Press Alt-V,S (or choose Locals Window from the View menu) to display the Locals Window. Click the "+" on the side of the object variable "myDocument" to expand the document tree. Look through the various objects in the Locals Window, and I think you'll start to understand the structure of the document.
Hope this helps!
Thanks,
Ole
Technical Details
Message-ID:
<1de7147f.2@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de7147f.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,4f7436ee13c8fd53 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-12-20 11:37:43 PST From: "Olav Kvern" <okvern@adobe.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: How to select an inline graphic? Message-ID: <1de7147f.2@WebX.la2eafNXanI> Date: Fri, 20 Dec 2002 11:25:50 -0800 References: <1de7147f.-1@WebX.la2eafNXanI> Lines: 35 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit