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.
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?
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.