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

Find and replace text across multiple Illustrator files

Community Beginner ,
Apr 27, 2018 Apr 27, 2018

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

15.2K
Translate
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

Community Expert , May 06, 2018 May 06, 2018

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,
...
Translate
Adobe
Explorer ,
Jan 21, 2021 Jan 21, 2021

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.

Translate
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 ,
Nov 18, 2021 Nov 18, 2021

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!

Translate
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 ,
Nov 23, 2021 Nov 23, 2021

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.

Translate
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
Explorer ,
Dec 15, 2021 Dec 15, 2021

After testing, the following metacharacters are not executed correctly: ^ $ /n (?<=) (?<!) (?=) (?!)

Translate
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 ,
Dec 11, 2023 Dec 11, 2023

Hi Carlos.

 

This script ALMOST works for me. I'm trying to replace any periods/full stops with commas but when I do that, it replaces all text with commas. Is there something I can add to the script to fix that maybe?

 

Thanks!

Translate
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 ,
Dec 11, 2023 Dec 11, 2023

Ignore me! Didn't see page 2 of this thread and someone asked exactly what I needed. Thanks so much!

Translate
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 ,
Apr 09, 2025 Apr 09, 2025
LATEST

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!

Translate
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