Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

Find and Replace Script for multiple files

$
0
0

I am trying to find a script that will either open a selection of .ai files or run through all the open files in illustrator and complete a Find and Replace. Right now I have a script that runs the Find and Replace but I have to run it on each document instead of all my open files.

 

var openDocument = app.documents.item(0);  
var search_string = /001D/gi; // g for global search, remove i to make a case sensitive search  
var replace_string = '001E';    
var text_frames = active_doc.textFrames;    
if (text_frames.length > 0)  
{      for (var i = 0 ; i < text_frames.length; i++)        {            var this_text_frame = text_frames[i];             var new_string = this_text_frame.contents.replace(search_string, replace_string);                          if (new_string != this_text_frame.contents)                 {                      this_text_frame.contents = new_string;                 }        }  
}

 

Thanks for any help.


Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>