Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CS2 index script not working with CS3

Explorer ,
Feb 12, 2009 Feb 12, 2009
Hi scriptwriters,<br /><br />We are currently working for book index in InDesign CS3. Before we were added the index topics, references to the documents in InDesign CS2 through java script. Now we are trying to use the same script for InDesign CS3. While running the script it shows some error in "text searching". I know that searching method is entirely different from CS2 to CS3. I have tried to solve the script error by modifying the script according to CS3 find text preferences. But I am not able to solve the error, so I have copied the pure CS2 script below. Please find the script below and help me for this by modifying it.<br /><br />//IndexFromArrayList_withOneSubtopic<br /><br />var level=0;<br />try{<br />for(k=0; k<app.documents.length; k++)<br />{<br />var myDoc = app.documents;<br />var arr = new Array(), x=0, j=0, i=0;<br />arr = [];<br />arr = ["acceptance", "action", "activity", "Adam and Eve"];<br />var myList, myTopic, myPageRef;<br /><br />level=0;<br />alert(k+1);<br />myList = myDoc.indexes.add(); <br /><br />for(i=0;i<arr.length;i++)<br />{<br /> x = myDoc.search(arr,false,false,arr);<br /> if((x.length>0)&(x.length>j))<br /> {<br /> myTopic = myList.topics.add(arr);<br /> myPageRef = myTopic.pageReferences.add(x);<br /> j++; i--;<br /> }<br /> else<br /> j=0;<br /> }<br /><br />//second - level<br />level=1;<br />alert(k+1);<br /><br />arr=[];<br />arr = ["action|vs. desire", "action|agitated", "action|see also karma", "activity|and diseases", "activity|and neuroses", "activity|internal and external"];<br /><br />for(j=0,i=0;i<arr.length;i++)<br />{<br /> x1 = arr;<br /> x1 = x1.split("|");<br /> x = myDoc.search(x1[1],false,false,x1[1]);<br /> if((x.length>0)&(x.length>j))<br /> {<br /> try<br /> {<br /> myTopic = myList.topics.item(x1[0]);<br /> myTopic1 = myTopic.topics.add(x1[1]);<br /> }<br /> catch(e)<br /> {<br /> continue;<br /> }<br /> myPageRef = myTopic1.pageReferences.add(x);<br /> <br /> y = x1[1];<br /> y = y.substring(0, 8);<br /> if(y == "see also")<br /> myPageRef.pageReferenceType = PageReferenceType.suppressPageNumbers;<br /> else<br /> myPageRef.pageReferenceType = PageReferenceType.currentPage;<br /> <br /> j++; i--;<br /> }<br /> else<br /> j=0;<br /> }<br /> }<br />}<br />catch(e)<br />{<br /> alert(e);<br /> alert(myDoc.name);<br />}<br /><br />//------------------------------<br /><br />Here the sample text to test the script;<br /><br />The even action feuguercing erit acceptance velit adipis activity nisim and diseases nullupt atincin utpat agitated ut inismodigna Adam and Eve augue dolortie et lut volor si ea faccummodit and neuroses nonulla mconulla internal and external commod eugueros aliquat wisisi.<br /><br />Thanks in advance<br />Thiyagu
TOPICS
Scripting
428
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 13, 2009 Feb 13, 2009
Have you tried putting the original (unmodified!) script into a folder "Version 4.0 Scripts" in the Scripts folder and running it from there? Most old scripts work just fine that way.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 16, 2009 Feb 16, 2009
LATEST
Hi Jongware,

First of all i want to thank you for your kind support. I have put script into Version 4.0 folder which is placed in the users library. And
I have open it from there and then run the script but it is not working. It shows the error. Could you please look into this and help me.

Regards
Thiyagu
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines