I found this script which work greats on any currently open Illustrator files, but I would like it to be able to run the action on a Mac OS folder, open the first Illustrator, runs this javascript, save & close that file, then loop through all other Illustrator files in a folder and repeat the process, until the last file.
- function FindAndReplaceScript_AllOpenDocuments(){
- for(var i=app.documents.length -1; i > -1; i--){
- app.documents[i].activate();
- var aDoc = app.documents[i];
- var searchString = /VT/gi;
- var replaceString = ‘VHB';
- var theTF = aDoc.textFrames;
- if (theTF.length > 0) {
- for (var j = 0 ; j <theTF.length; j++) {
- var aTF = theTF[j];
- var newString = aTF.contents.replace(searchString, replaceString);
- if (newString != aTF.contents) {
- theTF[j].contents = newString;
- }
- }
- }
- }
- };
- FindAndReplaceScript_AllOpenDocuments();