Article View: adobe.scripting.indesign
Article #20431Re: Object Reference?
From: Peter Boctor
Date: Wed, 31 Jul 2002 16:52
Date: Wed, 31 Jul 2002 16:52
27 lines
2200 bytes
2200 bytes
Jay, An object reference is a very simple concept. If you ask for any object, you'll get back an object reference. For example: page 1 of document 1 will return an object reference that looks something like this page id 119 of spread id 114 of document "Untitled-1" This is a reference to the page. You can store this in a variable to later find the page. Text however is different. When you ask for text, you don't get back an object reference, you get back that actual text. So you can ask for the "object reference" of text and you'll get something back that you can store in a variable. So, why do you aks is text different!? Well, it is because the AppleScript Language Guide says it should be so. I don't know the original reason for this, but I find it quite confusing. Why should text be the one exception? A little historical background: Prior to InDesign 1.5 (I think, I'm fuzzy on when this happened) InDesign returned object references all the time. We didn't have an "object reference" property since all objects implicitly returned an object reference. We got complaints from some diehard AppleScripters so we changed the behavior and in the process introduced the property "object reference" So the bottom line is, any time you want to store a reference to text, use the property object reference, any other time you want to store a reference to something, you can just ask for it and you'll get a reference back. -peter
Technical Details
Message-ID:
<ef9f3eb.2@WebX.aaQKaf7vad4>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<ef9f3eb.-1@WebX.aaQKaf7vad4>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,8b36b876f1d2154b X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-07-31 10:09:52 PST From: "Peter Boctor" <peter.boctor@adobe.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Object Reference? Message-ID: <ef9f3eb.2@WebX.aaQKaf7vad4> Date: Wed, 31 Jul 2002 09:52:10 -0700 References: <ef9f3eb.-1@WebX.aaQKaf7vad4> Lines: 41 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit