fabianmoronzirfas
12/21/2012 - 7:53 AM

for stackoverflow question http://stackoverflow.com/questions/13959744/why-script-will-sometimes-launch-extendscript-toolkit-just-stall/1397

// for stackoverflow 
// http://stackoverflow.com/questions/13959744/why-script-will-sometimes-launch-extendscript-toolkit-just-stall/13973259#comment19288901_13973259
// 
main();
function main(){


if ( app.documents.length > 0 && app.activeDocument.textFrames.length > 0 ) {

var searchTerms = new Array();
searchTerms.push({findWhat:"*",changeTo:"!"});
searchTerms.push({findWhat:"!",changeTo:"%"});


	for(var k = 0; k < searchTerms.length;k++){
		 var searchChar = searchTerms[k].findWhat;
		 var changeChar = searchTerms[k].changeTo;
		for ( i = 0; i < app.activeDocument.textFrames.length; i++ ) {
			var textArt = activeDocument.textFrames[i];
			for ( j = 0; j < textArt.characters.length; j++) {
				var myCharacter = textArt.characters[j];
				if(myCharacter.contents == searchChar){
					myCharacter.verticalScale = 120;
					myCharacter.horizontalScale = 140;
					myCharacter.baselineShift = -3;
					myCharacter.contents = changeChar;
					}
	
				}
	
			
			}
	
	app.redraw();
		}
	}
}