Copy link to clipboard
Copied
With the printers now looking for AI or EPS files, I have run into this problem a lot.
Is there a way to find and replace text across multiple Illustrator files like you can do in Indesign & Dreamweaver? It would save me days of double-clicking and pasting.
Please help.
Wayne
Hi Wayne, here's a script that replaces XXXX with NEW YORK across all open documents. Let me know if you need help changing the script to find something more meaningful.
// findReplace.jsx
// carlos canto
// https://forums.adobe.com/thread/2484457
function main () {
var idoc, search_string, replace_string, tframes, i, tframe, new_string, counter=0;
for (var a=0; a<app.documents.length; a++) {
idoc = app.documents[a];
search_string = /xxxx/gi; // g for global search,
...
Copy link to clipboard
Copied
Fantastic, Thanks.
Just what I needed to update small amount of text in hundreds of book illustrations.
However I do lose the text formatting which is a bit of a problem.
Copy link to clipboard
Copied
Hi @CarlosCanto, I have some Illustrator artwork that includes financial data that was created which formats text with periods (eg. $1.000.000) but I need to change to format it with comas (eg. $1,000,000). I tried to use this script by replacing . with , but that didn't work (it turned all my text into comas). Is there a particular way I should search or is there a way the script can be modified to account for that type of query?
Thanks in advance!
Copy link to clipboard
Copied
hi @ReingoldPredmore, add a backslash before the dot "\."
the dot by itself it's a reserved character that represents every character
that should take care of the problem.
Copy link to clipboard
Copied
After testing, the following metacharacters are not executed correctly: ^ $ /n (?<=) (?<!) (?=) (?!)
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Ignore me! Didn't see page 2 of this thread and someone asked exactly what I needed. Thanks so much!
Copy link to clipboard
Copied
Hi @CarlosCanto, thank you very much! The script seems to be working just fine. The only thing it messes up is formatting. Once there's some text in bold or with a different color at the beginning of the text area, the script changes the string but the whole text area also inherits the formatting from the very first character in the text area. Could you please provide some clarification on how to deal with this? Thank you so much!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now