-
Script to add Effects and change Effect properties is working sometimes only.
Hello everyone!
I am adding an effect to a layer and change some of its effect properties with a script. However, the first time I am loading up After Effects an error message appears:
‘Unable to execute script at line XXX. null is not an object’. I have marked the line where this happens.
When I close the the error message and run the script again (same instance of After Effects) it works flawlessly. No error message and the effect has been applied and its properties changed successfully. (Edit to add: I close the project after the discarding the error message.)
I’ve double-checked the effect’s name and the name of its properties. Has anyone got any idea what I am doing wrong?
Thank you,
DmyComp.openInViewer();
myComp.layer(1).selected = true;
app.executeCommand(app.findMenuCommandId("Linear Wipe"));/*
* The next line will throw the following error message if After Effects starts for the first time:
* "Unable to execute script at line XXX. null is not an object"
*/
myComp.layer(1).property("Effects").property("Linear Wipe")("Feather").setValue(50);
myComp.layer(1).property("Effects").property("Linear Wipe")("Transition Completion").setValueAtTime(startTime,100);
myComp.layer(1).property("Effects").property("Linear Wipe")("Transition Completion").setValueAtTime( myComp.layer( footageName[j-1] ).outPoint ,0);