Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Aug 20, 2020 Aug 20, 2020
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

TOPICS
How to , Scripting
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advocate , Aug 20, 2020 Aug 20, 2020

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;

Translate
Advocate ,
Aug 20, 2020 Aug 20, 2020

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;

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

Thanks! The documentation doesn't make that obvious! 

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