Skip to main content
Inspiring
October 11, 2019
Answered

Remove project

  • October 11, 2019
  • 1 reply
  • 1677 views

Hello!

I want to delete the project with all clips after I close it.

 

Steps:

1) First I open the project with command:

var open = app.openDocument(projectPathtruetruetrue);
2) I'm doing some work on the project...
3) I close project with command
close = project.closeDocument(00);
4) I want to delete project and all files related with project (all files in one folder).
I write the next function for delete files:
 
$._ext.removeFolder = function(folder) {
    var files = folder.getFiles();
    var filesCount = files.length;

    for (var i = files.length - 1i >= 0i--) {
        if (files[iinstanceof File) {
            files[i].remove();
        }
        else {
            $._ext.removeFolder(files[i]);
        }
    };

    folder.remove();
}
 
The project is deleted, but clip files are not deleted
 
files[i].remove() command for clips return false
I think what Premiere keep files
This topic has been closed for replies.
Correct answer Bruce Bullis

Files are not contained within a PPro project; they are referenced, at their current location(s), within the project. 

If you'd like to delete every piece of media referenced from within a given project, you'd get the path(s) from the associated projectItems, and delete each of those. 

Also, I find this workflow terrifying; I can imagine many ways this could go wrong, and do not recommend it.

1 reply

Bruce Bullis
Community Manager
Bruce BullisCommunity ManagerCorrect answer
Community Manager
October 11, 2019

Files are not contained within a PPro project; they are referenced, at their current location(s), within the project. 

If you'd like to delete every piece of media referenced from within a given project, you'd get the path(s) from the associated projectItems, and delete each of those. 

Also, I find this workflow terrifying; I can imagine many ways this could go wrong, and do not recommend it.

Inspiring
October 12, 2019

All files are in the same folder, so I don't need to take projectItem paths from the project. I know the folder where it all is

Let me describe the task in more detail. My task is as follows.
1) I am performing a sequence consolidation (https://github.com/Adobe-CEP/Samples/blob/master/PProPanel/jsx/PPRO/Premiere.jsx#L1664).
2) Next, I open the project resulting from the consolidation (openDocument()) and perform some manipulations with it.
3) I close the project resulting from the consolidation (closeDocument()), and send it to the server
4) I want to delete this temporary project resulting from consolidation

Inspiring
October 13, 2019

If you feel comfortable deleting that temporary project, you can...but if it's the new consolidated project, that doesn't sound temporary to me. 

Once you close the .prproj, you still know the file path to it; you can delete it using an ExtendScript File object.


I try to delete the files, using the File object, but I can not do it. Please look at the original question