script to run several queries to find/replace
Working on a big book of ID document (* .indb), I saved dozens of queries to search/replace (named "col01', 'col02' etc.) that I run on 'all documents '. For some reason, I have to run these queries several times a day.
So I'm wondering if he has, or if someone out there will write: a script that runs these queries one after another. Given the size of the book, it may be necessary to provide the script to pause after each query (before it turns on with the next), but I'm just guessing.
Any help is very appreciated!
- Pre-installed FindChangeByList script (in the folder "Scripts Panel > Samples")
- Script to change by queries to find
- Multi-find/change script (commercial)
Tags: InDesign
Similar Questions
-
Several queries on interactive report
Hi all
Is it possible to run several queries based on a condition in the creation of an interactive report? I mean
I want to execute a single query in the form
If: P12_QUERY == 1 then
first query
otherwise if: P12_QUERY == 2 then
second query
end if;
Please provide me with the syntax if its possible. Please help me in this regard.
With respect,
Sunil BhatiaOr
Quote the quote:
"first of all ask WHERE SOMETHING =" SOME "';"
Or
syntax of q
q'! first of all ask WHERE SOMETHING = 'SOME'!';
-
Do find / replaces several at the same time?
In PhotoShop, there is a practical tool, called 'ACTIONS' that allows you to automate several tasks. And in Microsoft Word, it is relatively easy to record a Macro that will do the same. Is there something similar in InDesign? Whenever I work with text, I do the following so often I want to automate:
1. replace all quotation marks simple quotes
2. place all the quotation marks double quotes
3. change the entire multiple single space
4 remove the trailing white space
Right now, I open the FIND/REPLACE box and run all 4 tasks manually.
Thank you
There is a findchangebylist script that will do this for you.
Bob
-
Need help with this find/replace Script.
Hi I got this script from Loic.Aigon. And I got it works for find/replace simple changes however I Cannon operate for several changes.
function cb5CallBack(target) { var findProps, changeProps; findProps = {findWhat:"Distributed by ",} changeProps = { changeTo:"Distributed by. ",} findProps = {findWhat:"Distribué par ",} changeProps = { changeTo:"Distribué par. ",} findProps = {findWhat:"Distribuido por ",} changeProps = { changeTo:"Distribuido por. ",}, RTXT(target, findProps, changeProps); }
function RTXT(target, findProps, changeProps) { app.findChangeTextOptions.caseSensitive = true; app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing; app.findTextPreferences.properties = findProps; app.changeTextPreferences.properties = changeProps; app.changeTextPreferences.properties = changeProps; target.changeText(); }
You must call the function RTXT repeatedly as well:
var findProps, changeProps;
findProps = { findWhat:"Distributed by "};
changeProps = { changeTo:"Distributed by. "};
RTXT(target, findProps, changeProps);
findProps = { findWhat:"Distribué par "};
changeProps = { changeTo:"Distribué par. "};
RTXT(target, findProps, changeProps);
findProps = { findWhat:"Distribuido por "};
changeProps = { changeTo:"Distribuido por. "};
RTXT(target, findProps, changeProps);
-
Find/replace, highlight found text script
Hello
I wrote this script and it works fine. But what I want to do is to go through each word found individually (as in the Find/Replace dialog box with the button "find next").
This is an excerpt:
app.findTextPreferences = app.changeTextPreferences = null;
var what = app.findTextPreferences.findWhat = "ensure";app.changeTextPreferences.changeTo = "make" sure;
var found = app.activeDocument.changeText ();
If {(found.length = 1)
Alert (found.length + "instance of"ensuring"changed");
} else {}
Alert (found.length + "instances of"ensuring"changed");
}I want the script to each instance of "ensure" my active selection that I can see where they are before I change.
Thank you
Hi guys,.
try this one:
app.findTextPreferences = app.changeTextPreferences = null; app.findTextPreferences.findWhat = "ensure"; app.changeTextPreferences.changeTo = "make sure"; var allFounds = app.activeDocument.findText(); for (var i = 0; i < allFounds.length; i++) { var curFound = allFounds[i]; curFound.select(); app.layoutWindows[0].zoomPercentage = app.layoutWindows[0].zoomPercentage; if(confirm("Do you wish to change this instance?",undefined, "Find/Replace")) { curFound.changeText(); } } app.findTextPreferences = app.changeTextPreferences = null;
Disadvantage of the confirm dialog box: there is no exit button.
-
How find/replace just a story of VB script.
Hi all
I use a lot of find/change grep options in my VB script. But find/replace replace always in each textframe I have on my current document. I would like to define just to do this on a story (which would be on the selected text blocks). Can anyone help? I try to find that in virtue of
FindChangeGrepOption, but I see this is not the place. I have attached the screenshot so you can see what I set in my VB script.Thank you.
The trick is to target the research of history of interest. In JavaScript, I would write something like this (with the first installation the find/replace):
myStory.changeGrep ();
Dave
-
How to find scripts that run in the background
Hey
I'm looking for which scripts to run in the background
Thank you
Open the Task Manager and go to the Details tab. If a VBScript or JScript is running the wscript.exe or cscript.exe process appear in the list.
Right-click on the column header and select 'Command Line'. That should tell you what script file is running.
-
Several Windows local sql scripts to run automatically.
Hi Experts, here's my dillemma.
Oracle DB version: 10G
Installed in: Sun solaris Sparc Unix machine.
Customer used in local machine: PLSQL developer version 10
I'm going to get a set of .sql files every week on my local machine to windows 7 especially recreate tables, insert data, and perform other actions of DB.
Our project aims to automate the process of sql executions.
Whatever the State of execution of the 1 file, execution should continue with the rest of the sql files & save errors and other messages.
But the problem here is
(1) we don't have access to the Unix machine where DB is installed to write a shell script and run these files.
(2) we have only customer plsql developer which interfaces with DB.
My life I worked with scripts Unix & plsql, but not having don't access Unix is a newthing to me & its driving me crazy.
Please give me advice on how to approach it.
(1) can use us plsql developer for pickthe local files & run them?
(2) can write us that all back base program in order to recover and run the local sql files.
Assumptions:
I think that PLSQL programming in itself is not a way to access the files stored in the local computer (my system and not the box Pb, in that it is installed).
Thank you for your time and response.
Tip:
use customer sqlplus to connect to db. and run your scripts in the bat file
-
Color of find/replace Word
I use InDesign CS5 on a mac.
I have set up a GREP search to replace the Word colors with the colors, I defined in InDesign. Works fine when I run it in InDesign. However, when I put the search in the FindChangeList.txt file and run the FindChangeByList.jsx script, I always get an error. He said: this is the error #17, line 172:
app.doScript (myString, ScriptLanguage.javascript); Anyone know why?
It comes to research, I put in the .txt file:
grep {, fillColor: "Word_R0_G128_B0"} {, fillColor: "Black"} {includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true, kanaSensitive:true, widthSensitive:true} //Replace Color Word
I came across several posts that say there are several free scripts that can run saved queries to GREP all at once, but they list the names of script or link to everything. Does anyone know a script that combines queries?
I think that it will fire on the part '{, '. Commas go between values, but you only have a single value. Just out this comma before "fillColor", in both places.
-
object contains no text for find/replace
I am trying to run this script to select text if it is found, but he said that there is no text, even though I have wrapped them in an if statement.
See section function () {}
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "the (section\\s +?). \\d+ ? [ \\.\\d+]?)";
app.changeGrepPreferences.changeTo = "$1";
The app.changeGrepPreferences reference .appliedCharacterStyle = "cross";
If (app.activeDocument.findText ()) {}
found. Select();
};
var changes1 = app.activeDocument.changeGrep ();
If {(changes1.length===1)}
Alert (changes1.length + "instance of 'the section' became 'article'.");
} else {}
Alert (changes1.length + "instances of 'the section' changed to 'section'.");
}
};
Your message to find/replace script highlight found text is not the same question?
-
Moving a text box automatically using find/replace?
I have a text box containing the given text (for example "Hello-hello12"), through several separate documents. I want to move this text box make a different location on the page of all these documents. Is it possible to do in bulk? I looked in the search/replace option, but could not find a way to do over there. I use CS6 if it matters.
Thank you!
It does however find/replace, but maybe the script though. Ask above in InDesign Scripting
-
ESXi 5.5 check if the custom script is running
Hello
I'm working on a solution, as remote custom for ESXi environments. The only area that I have a problem, is that I need to check if my (running locally on the ESXi host) shutdown script runs in reality or (to avoid running processes in doubles).
I know that in the ordinary Linux systems I can do things like (ps to the | grep "test.sh" | grep - v 'grep') or (c - stat %X /proc/ pgdump). This doesn't seem to work on ESXi.
Recommendations:
- This must be run locally on the remote site
- no access to the vCenter Orchestrator
- No windows
- The main system that will control the whole process is Debian
- Do not install any 3rd party on ESXi hosts
- Do not recommend N.U.T.S or APCUPSD
- Must be able to check if the script works not the commands in the script
- The real script runs several commands at different times
Test configuration:
- Create a loop file in /tmp/test.sh
#! / bin/sh
I have = 1
while [[ $i -le 1000000]]
do
echo 'Still running. Step $i'
((i = i + 1))
fact
- Make the file executable
- chmod + x /tmp/test.sh
- Run the test script
- Which can run to verify that the script still works?
Any help is appreciated.
Thank you
B
Ok. Spend many hours looking for a way to see who "sh" process to run my script, I gave up and continued in the way of what has suggested Alistar.
Solution: (linux - dirty way to ensure that only one instance of a shell script is running at a time - Stack Overflow)
Basically, we create a file locking with the PID on the inside. If the concurrent process give it a shot, they are arrested. You can also look in the locking file to find the PID, if you want to force the exit, the newspaper, etc...
For example
#!/bin/sh LOCKFILE=/tmp/lock.txt if [ -e ${LOCKFILE} ] && kill -0 `cat ${LOCKFILE}`; then echo "already running" exit fi # Remove the lockfile when process is exited trap "rm -f ${LOCKFILE}; exit" INT TERM EXIT echo $$ > ${LOCKFILE} #do stuff i=1 while [[ $i -le 1000000 ]] do echo "Still running. Step $i" let i=i+1 done rm -f ${LOCKFILE}
- This must be run locally on the remote site
-
Find/replace style cell with GREP
Hi all, (my first post here)
I found a script very useful on this forum to find/replace cell styles in an array. I adapted the script using Peter Kahrel ebook for use with a GREP query.
I've linked to a spreadsheet in InDesign CC 2014 I want to highlight the cell of new products that contain the value [Y].
When I run the script below, I get random results.
myDoc = app.activeDocument var
app.findGrepPreferences = app.changeGrepPreferences = null
app.findGrepPreferences.findWhat = "\[\u\"]
var myFound = myDoc.findGrep)
for (i = 0; i < myFound.length; i ++)
{
If (. parent.constructor.name myFound [i] == "Cell")
{
. parent.appliedCellStyle myFound [i] = "New_Product_Cell".
}
}
Modify the script that I wrote above.
Otherwise your discovery is just '[u]' ==> multi-ad found is--> Direct manufacturer name
Jarek
-
How to use styles to characters in find/replace JavaScripts?
First of all, good luck to Ole. It has been so useful (and a good writer, too). All the best!
My JavaScripts find/replace run trouble in line 159 of the ExtendScript Toolkit. The script is looking for a particular font, it is expected to then apply a character style. I use the format that I see in the example text 'FindChangeList' to Adobe, but the script is always hit a wall. What I am doing wrong? I wish I had a working method for research, not only for fonts, but also to find a paragraph or character style and apply a new style.
Simple stuff, but I'm roadblocked.
Here's the script until now:
This script applies the character style DFKai to the Arial Unicode font.
text {findWhat: "', appliedFont:" Arial Unicode MS", fontStyle:"Regular"} {appliedCharacterStyle: 'DFKai'} {include notes: true, include master pages: true include hidden layers: true, any word: false} find Unicode fonts; change the style of character DFKai.
Thanks for your help!
Gary Niemeier
Gary Niemeier says:
{include notes: true, include master pages: true include hidden layers: true, any word: false}
This not is not valid JavaScript, it looks like it was copied from a script AppleScript but not changed properly. Keys property for options must not contain spaces, they must be written:
{includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
-
Inconsistent behavior with find/replace Applescript
Hello
I am trying to add queries additional search/replace to the script by copying and pasting existing queries in the file FindChangeList.txt, then changing variables that are changed/wanted. I'm having mixed success though - sometimes I add a new query and it turns off one of the existing queries, other times I add a new query and it just doesn't work.
Is this something to do with the copy/paste items, or are there some rules around what order the elements must be in?
For example, it works fine:
text {find what: 'Mobile'} {change to: "M"} {include notes: true, include master pages: true include hidden layers: true, any word: false} find the Mobile and replace them with M.
Yet, just before it, does not work?
text {find what: 'Business'} {change to: 'B'} {include notes: true, include master pages: true include hidden layers: true, any word: false} find businesses and replace it with B.
We're just one copy of the other, so, what's the difference?
I love this script and the time it saves me, but more I tinker with it more, it seems inconsistent.
Any suggestion would be appreciated.
See you soon
Steve
Files in text format, you should really use TextWrangler http://www.barebones.com/products/textwrangler/
(or equivalent)...
Substances
Maybe you are looking for
-
How can I add contacts to a mailing list if they do not have an email address?
I try to add a contact to a mailing list and the contact has an e-mail address. In the mailing list, it says "type email addresses to add to the mailing list." I do a fake e-mail to those contacts who do not?
-
Frozen on Amazon, Firefox cannot load anything else much Favorites work.
Recently, the combustion chamber (my default browser) is frozen on Amazon.com. I can't download any sites newI. However, my favorites work when I click them. I tried Firefox to quit, have disabled my Imac and have tried to erase line several times. A
-
How to integrate synchronization FF in a website?
You want to integrate FF-sync in a Web site.How does it work?
-
LabVIEW Professional 2012 development system
Please provide us the link to download 2012 LabVIEW Professional Development System.
-
HP 15-r032TX: synaptics touchpad hangs
I have faced a lot of problems with the touchpad these days. It freezes a lot and sometimes double touch scrolling does not work, please help