Quantcast
Channel: Adobe Community : Discussion List - Illustrator Scripting
Viewing all articles
Browse latest Browse all 3671

Comparing strings

$
0
0

 

var sel = app.activeDocument.selection;

 

                       

for (i = 0; i < sel.characters.length; i++ ){        

    var character = sel.characters[i];

    alert(character)

    if(character == "1")

       {            

        character.characterAttributes.baselinePosition = FontBaselineOption.SUPERSCRIPT;

        }

}

I have this script that is supposed to replace every 1 with a superscript 1. The superscript part works but the if statement that compares the character to "1" doesn't. Can anyone help me?


Viewing all articles
Browse latest Browse all 3671


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