How to check if a property value is readonly using extendscript?
Given that the first item in the project is a comp with a solid in it, this works but it is arguably kludgey, and you'd need to be able to build the (each) string in order to do this -- but maybe you are already set up to do that:
var r;
r = testForReadability("app.project.items[1].layers[1].enabled");
alert(r);
r = testForReadability("app.project.items[1].layers[1].width");//a solid's width is NOT writable
alert(r);
function testForReadability(thisProperty) {
var x;
try {
x = eval(thisProperty);
eval(thisProperty + " = x;");
return true;
} catch(e) {
return false;
}
}
However, there is a small can of worms opening up here, in that "false"s will not work if the "Enable Script Debugger" option is set. So you need to do a workaround in order to check for this setting and temporarily reset it (see http://aenhancers.com/viewtopic.php?f=8&t=189&p=554&hilit=debugger#p554 )
I don't think you can get this information from the ESTK.
You can use the 'After Effects Scripting Guide Book' to check and create an object that contains all the 'readonly' properties, and then to check if the object includes this property.
Here's a link for the scripting guide: After-Effects-CS6-Scripting-Guide