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

script for running multiple find/change queries

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

27.0K

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

correct answers 1 Correct answer

Guru , Mar 01, 2013 Mar 01, 2013

Votes

Translate

Translate
Guru ,
Mar 01, 2013 Mar 01, 2013

Copy link to clipboard

Copied

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

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 ,
Mar 26, 2013 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!

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!

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
Guide ,
Aug 19, 2013 Aug 19, 2013

Copy link to clipboard

Copied

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

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
New Here ,
Jul 22, 2018 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!

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
New Here ,
Jan 06, 2019 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!

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
New Here ,
Jun 18, 2019 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(); 

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 ,
Jun 18, 2019 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

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

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
New Here ,
Jun 19, 2019 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"; 

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 ,
Jun 20, 2019 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

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

Copy link to clipboard

Copied

LATEST

Hi Mana,

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

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