Copy link to clipboard
Copied
Hi,
I have a book with 230 files in it and I wonder if it is possible to do a grep search in those files without open it.
My skill in scripting its quite low so here is my question ¿do i fight with the code to try it? or ¿is it better to drink a beer with my friends because it's not possible?
Thanks.
It's not even possible to open 230 documents: InDesign lets you open about 115 documents. One way to go about it is to create a simple script to do the replacement in one document, then use that script in a batch-processor like https://creativepro.com/files/kahrel/indesign/batch_convert.html
P.
Copy link to clipboard
Copied
Below is the general flow for opening a book document and closing it. You don't need to open all files at once; just iterate one at a time. You'd need to incporate your GREP routines into the script, probably as a separate routine in the while loop.
var bookContents = app.activeBook.bookContents;
var n = bookContents.length;
var d;
while (n--) {
//skip docs with pending changes
if (bookContents[n].status !== BookContentStatus.NORMAL) continue;
//need to do your own GREP find change routine
d = app.open(bookContents[n].fullName, false);
d.changeGrep();
d.close(SaveOptions.YES);
}
Copy link to clipboard
Copied
@nicosh I got around to adding character and paragraph styles. New update is live on my website. Have a look and see if that would work. All feedback is welcome. Thanks.
https://www.marspremedia.com/software/indesign/find-change-csv-multi-doc