Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Re: Words from index Panel - TOPIC and apply page references.

$
0
0

Well Forum!,,,

 

Here i got clue to find the topic word and relate to the document text and then add Pagereferences(~I) to the finded word.

 

But the problem is It find and place the pageReference symbol only for the first found.

 

I think, here im missing the way of refreshing find and replace and then continuing its process.

 

Could anybody look atthis script, to make to find and apply all the found instances
and then to run the taks faster...(I checked, if the document has more than two pages, the script take atleast 30 min to complete and the result is, it applied only for the first instances of the first search).

 

Please.....Help onthis


app.findGrepPreferences = app.changeGrepPreferences = null;

myDoc = app.activeDocument;

myStory = app.activeDocument.pages.everyItem();

gwords = app.activeDocument.indexes[0];

twords = app.activeDocument.indexes[0].topics.everyItem().pageReferences.every Item().toString();

var raj = new Array;

raj.push(twords);

app.findGrepPreferences = app.changeGrepPreferences = null;

var findWhat = app.findGrepPreferences.findWhat = (raj).toString();

founds = app.documents[0].findGrep();

for (i =0 ; i<founds.length; i++)

found = founds[i];

app.select(found);

 

myDoc.indexes[0].topics[0].pageReferences.add(found, PageReferenceType.currentPage );

//myDoc.indexes[0].topics.everyItem().pageReferences.add(found, PageReferenceType.currentPage);

app.findGrepPreferences = app.changeGrepPreferences = null;

gwords.update();

var myIndexStory = gwords.generate();

 

thanks.& regards..

bob....


Viewing all articles
Browse latest Browse all 37788

Trending Articles