Highlighted

ExtendScript-Access a precomp as a CompItem not as an AV Layer

New Here ,
Aug 20, 2020

Copy link to clipboard

Copied

In this case, I am selecting a precomp layer in the timeline but the problem is that this code below returns the AVLayer object instead of a CompItem object. How can I select the layer but get it as a CompItem? I need to do this because I want to then access the layers inside the precomp.
 
(Pretend I'm selecting a precomp layer.)
 

 

 

var comp = app.project.activeItem.selectedLayers[0];
alert(comp);

 

 

Capture.PNG

Adobe Community Professional
Correct answer by Tomas_Sinkunas | Adobe Community Professional

You need to use `source` property on a layer to get its item: http://docs.aenhancers.com/layers/avlayer/#avlayer-source

app.project.activeItem.selectedLayers[0].source;

Topics

How to, Scripting

Views

46

Likes

Translate

Translate

Report

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

ExtendScript-Access a precomp as a CompItem not as an AV Layer

New Here ,
Aug 20, 2020

Copy link to clipboard

Copied

In this case, I am selecting a precomp layer in the timeline but the problem is that this code below returns the AVLayer object instead of a CompItem object. How can I select the layer but get it as a CompItem? I need to do this because I want to then access the layers inside the precomp.
 
(Pretend I'm selecting a precomp layer.)
 

 

 

var comp = app.project.activeItem.selectedLayers[0];
alert(comp);

 

 

Capture.PNG

Adobe Community Professional
Correct answer by Tomas_Sinkunas | Adobe Community Professional

You need to use `source` property on a layer to get its item: http://docs.aenhancers.com/layers/avlayer/#avlayer-source

app.project.activeItem.selectedLayers[0].source;

Topics

How to, Scripting

Views

47

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

You need to use `source` property on a layer to get its item: http://docs.aenhancers.com/layers/avlayer/#avlayer-source

app.project.activeItem.selectedLayers[0].source;

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Thanks! The documentation doesn't make that obvious! 

Likes

Translate

Translate

Report

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