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

How to tell if footageSource is a layer of a file (e.g. a .psd layer or .ai layer)

Engaged ,
May 05, 2019 May 05, 2019

Copy link to clipboard

Copied

I want to duplicate a footageSource object, and I'm using something like this:

var oldSource = originalLayer.source;

newSource = app.project.importFile(new ImportOptions(oldSource.file));

This works fine if the original source is a flat file, like a jpg or movie file, but if it's a layer of a Photoshop image or Illustrator file it imports the whole file instead of just the layer. There doesn't seem to be any way to query a footageSource object to see if it's a layer of a multi-layer file, or not.

ImportOptions has an ImportOptions.importAs attribute, which means if I know whether the file is a layer I can specify

    ImportAsType.COMP_CROPPED_LAYERS

    ImportAsType.FOOTAGE

    ImportAsType.COMP

    ImportAsType.PROJECT

But the import type of a footage source doesn't seem to be part of the footageSource object.

TOPICS
Scripting

Views

596

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
community guidelines
Contributor ,
Dec 10, 2021 Dec 10, 2021

Copy link to clipboard

Copied

Hi stib,

Just wondering if you have found the answer for this besides the method to find "/" in the item name to show that it's a layer?

 

Votes

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
community guidelines
New Here ,
Jan 23, 2022 Jan 23, 2022

Copy link to clipboard

Copied

I have run into the same problem. If there is any new information out, I'd be happy know about it.

My last knowledge is to import the new file as a comp, then compare the name of the new items with the item you want to replace. But we run into a problem if a project item is renamed afterwards.

Votes

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
community guidelines
New Here ,
Apr 18, 2023 Apr 18, 2023

Copy link to clipboard

Copied

I'm running into this issue as well. Hope that adobe will add the ability to be able to replace the source files with layers of a file instead of just being able to replace flat files.

Votes

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
community guidelines
New Here ,
May 19, 2023 May 19, 2023

Copy link to clipboard

Copied

LATEST

Hi, after lots and lots of searching, I found a way to do it, not as straight forward but at least it works: basically, it involves saving the aep as xml (aepx) and from there you can simply replace the paths to the psd files. If you want, you can then save it back to .aep.

The whole context of my particular scenario:

* find missing footage
* replace everything but the psd files, which will be colleted in an array for later use
* save an xml file at this stage (son only the psd files will be missing)
* read the xml file, find and replace the psd paths. It will keep all layers and their original names in the comp (even if the user manually changed them)
* save the changes to the file
if you want, save the file to binary (aep) again.

Hope that helps

Votes

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
community guidelines