Thank you for your answer.
You can check and see the problem / bug yourself, to see the problem please act according to the instructions and do nothing extra.
You will need to close and restart After Effects, and then open a new Comp and open a new Solid and then run the script (which creates the Strok) and you will see that it does not work.
Do you have any idea how to solve this?
If you do other actions like delete layer and create a new one the script will work, but when I do the extra action in the code in the extenscript code it does not work.
Thank you very much, very much appreciate your help!
Indeed. You are correct. No LS Stroke is added in freshly launched AE with a solid.
As a workaround, you could do a following:
1. Create a new Solid and right click to add Layer Styles -> Stroke
2. Twirl down Layer Styles property under the Solid and select Stroke property (make sure nothing else is selected in the timeline).
3. Go to Animation menu and select Save Animation Preset. This will save an FFX file with Stroke layer style with its current values.
4. In your script, do the following:
var strokeFFX = new File('pathToStroke.ffx');
if (!strokeFFX.exists) {
throw new Error ('File does not exist at path ' + strokeFFX.fsName);
}
layer.applyPreset(strokeFFX);
var ls = layer.property('ADBE Layer Styles');
var lsStrokeProperty = ls.property('frameFX/enabled');
Keep in mind, that FFX files are not backward compatible. So if you need your script to run on CS6, you'll have to save this stroke FFX file from AE CS6.
Cheers.