Article View: adobe.scripting.indesign
Article #1711Re: CS3 Javascript - finding the paragraph which contain the index page reference
From: jxswm
Date: Tue, 27 Jan 2009 16:08
Date: Tue, 27 Jan 2009 16:08
32 lines
1355 bytes
1355 bytes
If you want get the paragrah n-th
//1st:
story_ix_para_obj = {};
story_para_ix_obj = {};
//2nd:
story = myText.parentStory;
id = story.id;
if(!story_para_obj[id]){
story_para_obj[id] = {};
paras = story.paragraphs;
paras_len = paras.length;
for(i = 0; i< lim; i++){ story_para_obj[id][i] = paras[i]; story_para_ix_obj[paras[i].toSource()] = i; } }
//third:
this_para_start = myText.paragraphs[0];
this_para_end = myText.paragraphs[-1];
//fourth:
this_page_start = -1, this_page_end = -1;
if(this_para_start == this_para_end){
//do some thing, get para_ix/get ix_para
}else{
//do some thing, get para_ix/get ix_para
}
//fifth: combine 1-4 into index's function
Jimmy Shen
(jxswm@126.com)
Technical Details
Message-ID:
<59b75803.20@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!newshub.sdsu.edu!webcrossingReferences:
<59b75803.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,4423827cf06ba747 X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: jxswm@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: CS3 Javascript - finding the paragraph which contain the index page reference Message-ID: <59b75803.20@webcrossing.la2eafNXanI> Date: Tue, 27 Jan 2009 08:08:20 -0800 References: <59b75803.-1@webcrossing.la2eafNXanI> Lines: 36 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit