Copy link to clipboard
Copied
So here is my dilemma and a BIG ASK!
I have a lot of documents (100s) that need company names removed from them that are in the text. Is there a script (plugin/something) that will search an Indesign document using the keywords (company names) from (for example an excel file) and highlight the text in the Indesign document where those words appear?
Open to other suggestions as well.
Thanks in advance.
Copy link to clipboard
Copied
You want to highlight them or delete them.
How many compagny name you have?
Copy link to clipboard
Copied
Hi Jean-Claude
I would say highlight them initially with a view to deleting. There are approx 200+ company names.
If I could search and highlight all in one go per document that is the aim
Copy link to clipboard
Copied
You could build a long query (with your 200 name), with underline custom format in change to, than save it.
Next you can use Peter Kahrel Script Grep Query Manager to run that query to a folder full of files.
GrepQueryManager > https://creativepro.com/files/kahrel/indesign/grep_query_manager.html
You can create you query that way, each comany name separaated by a pipe |
(?i)\b(cie1|cie2|cie3)\b
Copy link to clipboard
Copied
You can look at modifying the preinstalled FindChangeByList script. A breakdown of it is here:
Copy link to clipboard
Copied
That's an interesting one! I'll look at that and get my head around it. Thanks.
Copy link to clipboard
Copied
Hi agree with @brian_p_dts - this is the way that I would approach it.
Can you please let us know if this resolves your issue?
Copy link to clipboard
Copied
Modifying the FindChangeByList script is painful.
It will not allow the user to execute the query on 100 or more documents at once.
This is not the way to approach it.
Copy link to clipboard
Copied
Can be easily modified to operate on multiple docs/folder of docs.
Copy link to clipboard
Copied
So how would I get the 100+ names that I need searched for into the script? Would I separate them with a pipe?
set myFindChangeList to {"text", {find what:"Company A | Company B"}, {change to:"assistance of their leaders"},
Haven't scripted before, but always willing to learn!
Copy link to clipboard
Copied
I woud just add the rest of the line of code to new columns in the Excel, then export as CSV.
COL A: set myFindChangeList to {"text"
COL B: {find what: "company name"}
COL C: change to:"assistance of their leaders"
Necessary separator columns would be added by CSV.
Copy link to clipboard
Copied
Here is how you would modigy FCBL to run on all docs in a selected folder, right around line 72. Run the script with no file open.
else{
var myFol = Folder.selectDialog("Choose a folder with the INDDs");
if (!myFol || !myFol.exists) return;
var allDocs = myFol.getFiles("*.indd");
var tempDoc;
for (var ad = 0; ad < allDocs.length; ad++) {
try {
tempDoc = app.open(allDocs[ad]);
myFindChangeByList(app.documents.item(0));
tempDoc.close(SaveOptions.YES)
}
catch(e) {}
}
//alert("No documents are open. Please open a document and try again.");
}
Copy link to clipboard
Copied
If it’s to be used with FindChangeList Script...
You need to edit the findChangeStrings.txt file not the script itself
If you use TEXT Search mode. One company for each line.
text {findWhat:"company1"} {changeTo:"assistance of their leaders"}
text {findWhat:"company2"} {changeTo:"assistance of their leaders"}
text {findWhat:"company3"} {changeTo:"assistance of their leaders"}
etc...
if using GREP search mode (multiple company can be wrote in a single line.
grep {findWhat:"\\b(company1|company2|company3|etc..)\\b"} {changeTo:"assistance of their leaders"}
Copy link to clipboard
Copied
Thank you @Jean-Claude Tremblay I will have a go at this and report back. Thank you all for your help and knowledge.
Copy link to clipboard
Copied
Find and replace is the function. Find and replace with a character style.
There is a script delivered with and you can adapt it for your purpose.
Copy link to clipboard
Copied
Remember that you will also need to have some way of scanning for the text in placed graphics. e.g. if you have an organizational chart created in llustrator, you can't search for that in InDesign.
Copy link to clipboard
Copied
Good point Brad @ Roaring Mouse
Copy link to clipboard
Copied
You could also us Multi Find/Change extension to load a CSV directly. This is a paid extension but it worth all the 60$. Many others useful features.
Copy link to clipboard
Copied
And here another suggestion:
If you have a functional script* you can run it with Peter Kahrel's Batch Process script on open InDesign documents, on all InDesign documents of a specific folder or on all InDesign documents in a nested folder structure:
https://creativepro.com/files/kahrel/indesign/batch_convert.html
*scroll down to section:
Run a script
and read into the notes at "Important".
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Thank you all. I'm still working on a solution.