var sel = app.activeDocument.selection; for (i = 0; i < sel.characters.length; i++ ){ var aChar = sel.characters[i]; if(aChar.contents =="~") { sel.characters[i+1].characterAttributes.baselinePosition = FontBaselineOption.SUPERSCRIPT; if (sel.characters[i+2].contents == "0" || sel.characters[i+2].contents == "1" || sel.characters[i+2].contents == "2" || sel.characters[i+2].contents == "3" || sel.characters[i+2].contents == "4" || sel.characters[i+2].contents == "5" || sel.characters[i+2].contents == "6" || sel.characters[i+2].contents == "7" || sel.characters[i+2].contents == "8" || sel.characters[i+2].contents == "9" ) { sel.characters[i+2].characterAttributes.baselinePosition = FontBaselineOption.SUPERSCRIPT; } aChar.remove() } } } }
So I have this script that will convert a whole bunch of numbers in the text selection to superscript numbers. I am running this on a selection of about 44,000 words so I expected it to take a while, however it has been running for over 32 hours at this stage. Is there something I'm doing wrong? I'm on a deadline and this is becoming beyond a joke.