Article View: adobe.scripting.indesign
Article #2014Re: (JS) Find Page of Object
From: Dave_Saunders
Date: Tue, 13 Jan 2009 12:51
Date: Tue, 13 Jan 2009 12:51
17 lines
1704 bytes
1704 bytes
Thanks Harbs, interesting points. 1. I've resisted the use of while(theObj) because it just feels unnatural from a readability point of view. It might be worth setting up a timing test to compare the speed of it with while(theObj != null). Your idea of moving the catch for Page into the switch is interesting. That would actually make it impossible to drop out the bottom of the while loop. 2. A test for null catches undefined values. I've always used that test, so I'm going to stay with it. Again, the form if(!theObj) strikes me as something I'd have to pause and think about for a moment each time I read it, so I tend not to use that construction. 3 & 4. Aha, I never thought about footnote references and notes. They hardly ever come up in my scripts so I hadn't had the need to think about them. 5. "infinitely"? At one point, my version of this function did indeed return the last text frame of a story if the object were in overset text, but I ended up realizing that this was rarely useful and indeed misleading. But it is an option that is occasionally needed. Thanks for the feedback. Dave
Technical Details
Message-ID:
<59b77ee3.5@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!newshub.sdsu.edu!webcrossingReferences:
<59b77ee3.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,54700b22cee37b94 X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Dave_Saunders@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: (JS) Find Page of Object Message-ID: <59b77ee3.5@webcrossing.la2eafNXanI> Date: Tue, 13 Jan 2009 04:51:10 -0800 References: <59b77ee3.-1@webcrossing.la2eafNXanI> Lines: 29 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit