Premiere Pro Scripting (QE) - Referencing a newly created Layer

Community Beginner ,
Feb 03, 2021

Copy link to clipboard

Copied

Hi! I've been trying to add a "newTransparentVideo();" and was able to do so but, since it returns a bool I cant find a way to reference it to add effects &/or rename.
You might think just looking into the "rootItem" and looking for the default name would be a solution but, from one language to another, the name changes so that cant be an option.

this is my last hope. Thank you whoever can help me!

 

 

PS: pretty please update the API... since 2012 I see "updating soon" and yet there is still "Effects Match Names" that have no use for the only line to create effect (getVideoEffectByName() ). I can make a list of things that makes no sence but I dont blame anyone I just find it odd.

TOPICS
Effects and Titles, Error or problem, How to, SDK

Views

87

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

1 Correct Answer

Explorer , Feb 03, 2021
Ivan Stepanov Explorer , Feb 03, 2021
One way would be to get nodeId of each item in root and then compare them with nodeId after creating new item.Though, surprisingly, it is much easier:var numItems = app.project.rootItem.children.numItems; // num of items in root, before creating new one // here goes your code to create new item var newItem = app.project.rootItem.children[numItems]; // your new item Any new item is just pushed to array.

Likes

Translate

Translate
Jump to answer Jump to answer
Explorer ,
Feb 03, 2021

Copy link to clipboard

Copied

One way would be to get nodeId of each item in root and then compare them with nodeId after creating new item.

Though, surprisingly, it is much easier:

var numItems = app.project.rootItem.children.numItems; // num of items in root, before creating new one

// here goes your code to create new item

var newItem = app.project.rootItem.children[numItems]; // your new item

 Any new item is just pushed to array.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
MaxLP AUTHOR LATEST
Community Beginner ,
Feb 03, 2021

Copy link to clipboard

Copied

Wow... I thought about it but did not think that would actually work im feeling so dumb. I Thank you so much!

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more