🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
3 messages
3 total messages Started by thiyagus5 Fri, 13 Feb 2009 07:26
CS2 script not working in CS3
#1259
Author: thiyagus5
Date: Fri, 13 Feb 2009 07:26
72 lines
2945 bytes
Hi scriptwriters,

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.

//IndexFromArrayList_withOneSubtopic

var level=0;
try{
for(k=0; k<app.documents.length; k++) { var myDoc = app.documents[k]; var arr = new Array(), x=0, j=0, i=0; arr = []; arr = ["acceptance", "action", "activity", "Adam and Eve"]; var myI, myT, myPRf;

level=0;
alert(k+1);
myI = myDoc.indexes.add();

for(i=0;i<arr.length;i++) { 	x = myDoc.search(arr[i],false,false,arr[i]); 	if((x.length>0)&(x.length>j))
	{
		myT = myI.topics.add(arr[i]);
		myPRf = myT.pageReferences.add(x[j]);
		j++; i--;
	}
	else
		j=0;
	}

//second - level
level=1;
alert(k+1);

arr=[];
arr = ["action|vs. desire", "action|agitated", "action|see also karma", "activity|and diseases", "activity|and neuroses", "activity|internal and external"];

for(j=0,i=0;i<arr.length;i++) { 	x1 = arr[i]; 	x1 = x1.split("|"); 	x = myDoc.search(x1[1],false,false,x1[1]); 	if((x.length>0)&(x.length>j))
	{
		try
		{
		 myT = myI.topics.item(x1[0]);
		 myT1 = myT.topics.add(x1[1]);
		}
		catch(e)
		{
		 continue;
		}
		myPageRef = myT1.pageReferences.add(x[j]);

		y = x1[1];
		y = y.substring(0,8);
		if(y == "see also")
		 myPageRef.pageReferenceType = PageReferenceType.suppressPageNumbers;
		else
		 myPageRef.pageReferenceType = PageReferenceType.currentPage;

		j++; i--;
		}
	else
		j=0;
		}
	}
}
catch(e)
{
	alert(e);
	alert(myDoc.name);
}

//------------------------------

Here the sample text to test the script;

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.

Thanks in advance
Thiyagu
Re: CS2 index script not working with CS3
#1282
Author: jongware
Date: Fri, 13 Feb 2009 20:10
1 lines
815 bytes
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.
Re: CS2 index script not working with CS3
#1104
Author: thiyagus5
Date: Tue, 17 Feb 2009 02:08
7 lines
899 bytes
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads