Article View: adobe.scripting.indesign
Article #20244Re: Object Reference?
From: Shane Stanley
Date: Thu, 01 Aug 2002 00:14
Date: Thu, 01 Aug 2002 00:14
42 lines
2536 bytes
2536 bytes
in article ef9f3eb.2@WebX.aaQKaf7vad4, Peter Boctor wrote: > I don't know the original reason for this, but I find it quite confusing. Why > should text be the one exception? It's an exception in the name of consistency ;-) Let's say I have this statement: set myWord to word 1 of "Why should text be the one exception?" myWord will contain "Why", and not a reference to the first word of the string. Could it realistically do anything else? Now let's try something roughly like this: tell app "InDesign 1" set myWord to word 1 of "Why should text be the one exception?" set yourWord to word 1 of story 1 of document 1 set otherWord to word 1 of label of text frame 1 of document 1 end tell Here, "word 1 of..." will return different things depending on the target, and that too can be quite confusing. I guess the bottom line is that some apps don't need/use references, so it's more consistent for the sake of the language if everyone adopts the same convention. > 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" Further historical background. In the first scriptable version of Brand X, it returned the contents all the time. It didn't have an "object reference" property for text. They got complaints and in the process introduced the property "object reference" for text. -- some diehard AppleScripter
Technical Details
Message-ID:
<B96EBAA1.37C52%sstanley@myriad-com.com.au>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!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> <ef9f3eb.2@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 17:48:07 PST From: Shane Stanley <sstanley@myriad-com.com.au> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!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: <B96EBAA1.37C52%sstanley@myriad-com.com.au> Date: Wed, 31 Jul 2002 17:14:58 -0700 References: <ef9f3eb.-1@WebX.aaQKaf7vad4> <ef9f3eb.2@WebX.aaQKaf7vad4> Lines: 54 User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.0.3 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit