Adobe-CEP / Samples

Code samples for CEP extensions
MIT License
972 stars 551 forks source link

Delete files from a project #116

Closed AlexanderSuvorov closed 4 years ago

AlexanderSuvorov commented 4 years ago

Hi.

Is there any way to remove the file from the project, or replace it with another file. I want to give a choice to the user of my extension what to do if the imported file already exists in the project.

Thanks.

bbb999 commented 4 years ago

Which host application(s)?

AlexanderSuvorov commented 4 years ago

Premiere Pro in priority. Perhaps in the future this feature will be needed in After Effects too.

bbb999 commented 4 years ago

var ignoreSubclips = true; var matchingProjectItemsFound = app.project.rootItem.findItemsMatchingMediaPath(newPath, ignoreSubclips);

// that will give you an array of projectItems with the same path. // If the array is length 0, no matches.

To remove projectItems, put them into a bin (which you can create), then delete the bin.

AlexanderSuvorov commented 4 years ago

It works for me. Thank you.