Highlighted

script for running multiple find/change queries

Explorer ,
Mar 01, 2013

Copy link to clipboard

Copied

Working on a large ID book document (*.indb), I have saved several dozens of Find/Change Queries (named "col01", "col02" etc.) that I run on "All documents". For a particular reason I have to run these queries several times a day.

So I was wondering whether there is, or whether anybody out there would write, a script that runs these queries one after the other. Given the size of the book, it might be necessary to provide for the script to pause after each query is run (before it goes on with the next), but I am just guessing.

Any help is much appreciated!

Topics

Scripting

Views

19.5K

Likes

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

script for running multiple find/change queries

Explorer ,
Mar 01, 2013

Copy link to clipboard

Copied

Working on a large ID book document (*.indb), I have saved several dozens of Find/Change Queries (named "col01", "col02" etc.) that I run on "All documents". For a particular reason I have to run these queries several times a day.

So I was wondering whether there is, or whether anybody out there would write, a script that runs these queries one after the other. Given the size of the book, it might be necessary to provide for the script to pause after each query is run (before it goes on with the next), but I am just guessing.

Any help is much appreciated!

Topics

Scripting

Views

19.5K

Likes

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
Guru ,
Mar 01, 2013

Copy link to clipboard

Copied

Likes

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
Reply
Loading...
Guru ,
Mar 05, 2013

Copy link to clipboard

Copied

Here’s yet another script: DoQueryList by Mikhail Ivanyushin. User manual in English is included inside the download package.

doquerylist.jpg

To change the language in the dialog box from Russian to English/German/French, click the “flag” icon in the left bottom corner.

Likes

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
Reply
Loading...
Adobe Community Professional ,
Mar 26, 2013

Copy link to clipboard

Copied

There are a couple of others:

http://forums.adobe.com/message/5173943#5173943

this is more at code level rather than a GUI, but the actual queries are made using the Find/Change dialog box.

Also

http://www.kahrel.plus.com/indesign/grep_query_manager.html

This is good too, but only does GREP searches (no text, glyph or object find/replaces) that were written by the user - does not use the ones installed with InDesign. Does allow changes by selection, story, document or folder.

Did try the Doquerylist suggested by Kasyan. This allows GREP/text changes by the user/installed with InDesign, but only applies to a selection or text-thread.

Always good to have more than one way of accomplishing a task though!

Likes

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
Reply
Loading...
Advisor ,
Aug 19, 2013

Copy link to clipboard

Copied

Likes

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
Reply
Loading...
Engaged ,
Aug 19, 2013

Copy link to clipboard

Copied

I found another one here. Not tested yet

https://github.com/fabiantheblind/batch-find-and-replace

g

Likes

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
Reply
Loading...
New Here ,
Jul 22, 2018

Copy link to clipboard

Copied

I kept getting errors with the FindChangeByList that came with indesign. This one is great and has a really nice interface! Thank you Pickory!

Likes

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
Reply
Loading...
New Here ,
Jan 06, 2019

Copy link to clipboard

Copied

Does anyone know of a way to use a series of s&r with style options? Can I  save a list of queries and then run them in all open files? Or even better, in all files in a folder!

Likes

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
Reply
Loading...
New Here ,
Jun 18, 2019

Copy link to clipboard

Copied

Hi,

I have a some problem at find and change can you tell me how to loop used

Please see below my code

app.findTextPreferences = NothingEnum.nothing; 

    app.changeTextPreferences = NothingEnum.nothing; 

     

    app.findTextPreferences.findWhat = "\t\t"; 

    app.changeTextPreferences.changeTo = "\t"; 

     

    //this will show changes count 

    alert(app.activeDocument.changeText().length); 

     

    app.activeDocument.changeText(); 

Likes

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
Reply
Loading...
Adobe Community Professional ,
Jun 18, 2019

Copy link to clipboard

Copied

Hi Mac Magesh,

If you want to loop over the text that matches you criteria you could just use the findText method instead of changeText and then change it with whatever you want. Something like below

app.findTextPreferences = NothingEnum.nothing;

app.changeTextPreferences = NothingEnum.nothing;

app.findTextPreferences.findWhat = "\t\t";

//app.changeTextPreferences.changeTo = "\t";

var foundText = app.activeDocument.findText(true)

alert("Found " + foundText.length + " instances of the search string")

for(var i = 0; i < foundText.length; i++)

{

    //Make the change or anything that you want to do with the found instance

    foundText.contents = "\t"

}

-Manan

Likes

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
Reply
Loading...
New Here ,
Jun 18, 2019

Copy link to clipboard

Copied

Thanks Mana,

app.findTextPreferences = NothingEnum.nothing; 

app.changeTextPreferences = NothingEnum.nothing; 

 

app.findTextPreferences.findWhat = "\r\r"; 

app.changeTextPreferences.changeTo = "\r"; 

app.findTextPreferences.findWhat = "  "; 

app.changeTextPreferences.changeTo = " "; 

I have a double enter mark and space clear but my result only some enter mark only clean and space also please help me

-Mahesh B

Likes

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
Reply
Loading...
New Here ,
Jun 19, 2019

Copy link to clipboard

Copied

HI Good morning..........

I have a some problem at my script please help i want find at bold text change to apply character style please help me 

app.findTextPreferences = NothingEnum.nothing; 

app.changeTextPreferences = NothingEnum.nothing; 

 

app.findTextPreferences.appliedFont = app.fonts.item = "ZapfCalligr BT Bold";

app.changeTextPreferences.appliedCharacterStyle = "Bold"; 

Likes

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
Reply
Loading...
Adobe Community Professional ,
Jun 20, 2019

Copy link to clipboard

Copied

Hi Again,

As i suggested to you not to post multiple unrelated queries in a single old thread in another post. Please create your own thread with proper details on what issue you are facing. In the initial question you mentioned that you want to loop over the find results now you have totally changed the question.

-Manan

Likes

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
Reply
Loading...
New Here ,
Jun 20, 2019

Copy link to clipboard

Copied

Hi Mana,

word file i will import the in-design  bold, italic, superscript, subscript how to i will change the script   

Likes

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
Reply
Loading...