Article View: adobe.scripting.indesign
Article #19830Re: What use is an object's ID?
From: Olav Kvern
Date: Mon, 18 Nov 2002 03:35
Date: Mon, 18 Nov 2002 03:35
28 lines
1667 bytes
1667 bytes
Shane, Mike--
A few quick notes:
1. Object ID is document-wide. No need to specify a page, a spread, or anything else.
2. No other object can have the same ID in the document. I doubt that even a new item would take the ID of a previously-deleted item.
3. VB users will have to iterate to find the matching ID (and, again, you can't use For Each...Next for your iteration). So you probably want something like:
Rem Given a Document "myDocument" and an ID "myID"...
For myCounter = 1 to myDocument.AllPageItems.Count
If AllPageItems.Item(myCounter).ID = myID Then
myPageItem = AllPageItems.Item(myCounter)
Exit For
End If
Next
Luckily, iteration is fast, and AllPageItems is a collection of all of the page items on the document pages of the document.
Thanks,
Ole
Technical Details
Message-ID:
<1de6a0d6.7@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-06!sn-xit-04!supernews.com!newsfeed.gamma.ru!Gamma.RU!newsfeed.esat.net!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de6a0d6.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,69b6010c913419c7 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-11-17 19:52:46 PST From: "Olav Kvern" <okvern@adobe.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-06!sn-xit-04!supernews.com!newsfeed.gamma.ru!Gamma.RU!newsfeed.esat.net!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: What use is an object's ID? Message-ID: <1de6a0d6.7@WebX.la2eafNXanI> Date: Sun, 17 Nov 2002 19:35:24 -0800 References: <1de6a0d6.-1@WebX.la2eafNXanI> Lines: 29 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit