Given that the first element in the project is comp with hardness in it, this works, but maybe it is kludgey, and for this you will need to build (every) line to do this - but maybe you are already set up for this :
var r; r = testForReadability("app.project.items[1].layers[1].enabled"); alert(r); r = testForReadability("app.project.items[1].layers[1].width");//a solid width is NOT writable alert(r); function testForReadability(thisProperty) { var x; try { x = eval(thisProperty); eval(thisProperty + " = x;"); return true; } catch(e) { return false; } }
Nevertheless, a small bank of worms opens in which “false” ones will not work if the option “Enable Script debugger” is set. Therefore, you need to make a workaround to check this parameter and temporarily reset it (see http://aenhancers.com/viewtopic.php?f=8&t=189&p=554&hilit=debugger#p554 )
source share