Page 1 of 1

Can't write to The applyStroke attribute

Posted: Fri Dec 30, 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.
         
[color=#3a91d7][font=adobe-clean, Helvetica Neue, Arial, sans-serif][img=620x187]https://forums.adobe.com/servlet/JiveServlet/downloadImage/2-9230707-1093526/1.png[/img][/font][/color]
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: Wed Jan 04, 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.
var myComp = app.project.activeItem;
var myTextProp = myComp.layer(1).sourceText;
var myText = myTextProp.value;
myText.applyStroke = true;
myTextProp.setValue(myText);