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

Finding and highlighting from Excel

Community Beginner ,
Jan 06, 2022 Jan 06, 2022

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.

TOPICS
Scripting

Views

466

Translate

Translate

Report

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 ,
Jan 06, 2022 Jan 06, 2022

Copy link to clipboard

Copied

You want to highlight them or delete them.
How many compagny name you have?

Votes

Translate

Translate

Report

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 Beginner ,
Jan 06, 2022 Jan 06, 2022

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

Votes

Translate

Translate

Report

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 ,
Jan 06, 2022 Jan 06, 2022

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

 

Votes

Translate

Translate

Report

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 ,
Jan 06, 2022 Jan 06, 2022

Copy link to clipboard

Copied

You can look at modifying the preinstalled FindChangeByList script. A breakdown of it is here: 

 

https://yourscriptdoctor.com/findchangebylist/

Votes

Translate

Translate

Report

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 Beginner ,
Jan 06, 2022 Jan 06, 2022

Copy link to clipboard

Copied

That's an interesting one! I'll look at that and get my head around it. Thanks.

Votes

Translate

Translate

Report

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 ,
Jan 06, 2022 Jan 06, 2022

Copy link to clipboard

Copied

Hi agree with @brianp311 - this is the way that I would approach it.

 

Can you please let us know if this resolves your issue?

 

Votes

Translate

Translate

Report

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 ,
Jan 07, 2022 Jan 07, 2022

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.

Votes

Translate

Translate

Report

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 ,
Jan 07, 2022 Jan 07, 2022

Copy link to clipboard

Copied

Can be easily modified to operate on multiple docs/folder of docs. 

Votes

Translate

Translate

Report

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 Beginner ,
Jan 07, 2022 Jan 07, 2022

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!

 

Votes

Translate

Translate

Report

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 ,
Jan 07, 2022 Jan 07, 2022

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. 

Votes

Translate

Translate

Report

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 ,
Jan 07, 2022 Jan 07, 2022

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.");
	}

 

Votes

Translate

Translate

Report

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 ,
Jan 07, 2022 Jan 07, 2022

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"}	




Votes

Translate

Translate

Report

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 Beginner ,
Jan 07, 2022 Jan 07, 2022

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.

Votes

Translate

Translate

Report

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 ,
Jan 06, 2022 Jan 06, 2022

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.

Votes

Translate

Translate

Report

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 ,
Jan 07, 2022 Jan 07, 2022

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.

Votes

Translate

Translate

Report

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 Beginner ,
Jan 07, 2022 Jan 07, 2022

Copy link to clipboard

Copied

Good point Brad @ Roaring Mouse 

Votes

Translate

Translate

Report

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 ,
Jan 07, 2022 Jan 07, 2022

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.

https://www.automatication.com/product/mfc/

Votes

Translate

Translate

Report

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 ,
Jan 07, 2022 Jan 07, 2022

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 )

Votes

Translate

Translate

Report

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 Beginner ,
Jan 14, 2022 Jan 14, 2022

Copy link to clipboard

Copied

LATEST

Thank you all. I'm still working on a solution.

Votes

Translate

Translate

Report

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