Page 1 of 1

Can't write to The applyStroke attribute

Posted: December 30th, 2016, 7:04 am
by Aaron_Ecthelion
I have several lines of simple code like this:
     var myComp = app.project.activeItem;
     var myLayer = myComp.layer(1);
     myLayer.sourceText.value.applyStroke = true;
     alert(myLayer.sourceText.value.applyStroke);
 
 
However, the applyStroke doesn't work properly, I can read its value, but can't write it. According to the official scripting guide, it's read/write.
         
[img=620x187]https://forums.adobe.com/servlet/JiveSe ... 3526/1.png[/img]
But the 3rd line just doesn't work! I wonder why! Is this a bug? !
Hope I've made myself clear.

Re: Can't write to The applyStroke attribute

Posted: January 4th, 2017, 4:52 pm
by jordanwade33
I'm not sure if you've already solved this, but I ran into something similar with Markers, so I thought I would share my experience. 

It is read/write, but you need to set the value again after changing it, it doesn't update automatically. If you want to change other attributes (font size, colors, etc.), just change those before the setValue. The code below seems to work, hopefully it makes sense.

Code: Select all

var myComp = app.project.activeItem;
var myTextProp = myComp.layer(1).sourceText;
var myText = myTextProp.value;
myText.applyStroke = true;
myTextProp.setValue(myText);