Need help about a script! (New to scripting)
Posted: July 5th, 2017, 4:03 am
Hello everyone.
I'm brand new to scripting (a few hours),
and I have a script I need help with.
Basically I want to make new comps from selected layers and have the start timecode to begin on 0,
I think I've made that one correct.
However... I'm getting this line "Undefined is not an object" when running the script.
The script does what I want it to do, but this error is bugging me and I want to learn how
to correct that error.
Hopefully some gently souls will help me out!
Thanks in advance,
StanTheMan
Script:
var selectedItems = app.project.selection;
for (var i=0; i <= selectedItems.length; i++) {
var myComp = app.project.items.addComp(selectedItems.name, selectedItems.width, selectedItems.height, selectedItems.pixelAspect, selectedItems.duration, selectedItems.frameRate);
myComp.layers.add(selectedItems);
myComp.displayStartTime = 0;
}
I'm brand new to scripting (a few hours),
and I have a script I need help with.
Basically I want to make new comps from selected layers and have the start timecode to begin on 0,
I think I've made that one correct.
However... I'm getting this line "Undefined is not an object" when running the script.
The script does what I want it to do, but this error is bugging me and I want to learn how
to correct that error.
Hopefully some gently souls will help me out!
Thanks in advance,
StanTheMan
Script:
var selectedItems = app.project.selection;
for (var i=0; i <= selectedItems.length; i++) {
var myComp = app.project.items.addComp(selectedItems.name, selectedItems.width, selectedItems.height, selectedItems.pixelAspect, selectedItems.duration, selectedItems.frameRate);
myComp.layers.add(selectedItems);
myComp.displayStartTime = 0;
}