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

Editing the leading on a created textFrame

$
0
0

Hi,

 

I have no idea why the following code will not work.

The text displays in the correct place with the correct contents but i cannot get the leading to change.

 

var textInfo = app.activeDocument.textFrames.add();

textInfo.name = "textInfo";

textInfo.position = [30,-30];

textInfo.contents = "A";

textInfo.autoLeading = false;

 

for(var i = 0; i<app.activeDocument.textFrames["textInfo"].textRange.characters.length; i++){

    app.activeDocument.textFrames["textInfo"].textRange.characters[i].characterAttributes.lea ding = 18;

    redraw();

    $.writeln(app.activeDocument.textFrames["textInfo"].characters[i].characterAttributes.lea ding);

    }


I have also tried textInfo.leading = 18; with no luck.


The write line function at the end is reading the correct leading but the line above is not editing it.


Adobe illustrator CS6, Mac OS 10.6, Javascript/extendscript

 

Also, not too sure what auto leading does so have tried both with and without.


Thanks,

Tom


Viewing all articles
Browse latest Browse all 12845

Trending Articles



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