Article View: adobe.scripting.indesign
Article #2499Re: [IDCS3] [JS] Access/Retrieve part of a Story by Index
From: Dave_Saunders
Date: Sat, 13 Dec 2008 16:28
Date: Sat, 13 Dec 2008 16:28
7 lines
1126 bytes
1126 bytes
You don't need to select the text (although this probably needs to be deconstructed some because you need to be sure the index - 15 is greater than zero and the other expression is less than or equal to the textflow length): $.writeln(_findErg[i].parent.characters.itemByRange(index-15, index+15+_findErg[i].length).texts[0].contents); And note that I used parent and not parentStory. That allows it to work with text inside table cells. Dave
Technical Details
Message-ID:
<59b74298.0@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!webcrossingReferences:
<59b74298.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,851dc1f147eb570b X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Dave_Saunders@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: [IDCS3] [JS] Access/Retrieve part of a Story by Index Message-ID: <59b74298.0@webcrossing.la2eafNXanI> Date: Sat, 13 Dec 2008 08:28:13 -0800 References: <59b74298.-1@webcrossing.la2eafNXanI> Lines: 6 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Original-Lines: 12