Highlighted

Looking for a way to move footage files into a subfolder using scripting

Participant ,
Nov 16, 2020

Copy link to clipboard

Copied

I have a script that gets the selected footage items in the project window and adds it all to a new comp in the same folder as the footage. However, I want to improve this by then taking the selected footage, creating a folder named "Footage" at the same level as the comp, ie - not root, and moving the selected footage into it. The comp will stay where it is. The final folder hierarchy should look like this…

 

ROOT
    Folder
        COMP_v01
        Footage folder
            FootageA
            FootageB
            FootageC
            etc

 

 

I found this possible starting point on Creative Cow, but I can't figure out how to integrate its approach into my script. Sorry, I'm quite new at this… https://creativecow.net/forums/thread/script-to-create-folder-and-move-footage-within-ae

 

I'm getting lost with the parentFolder stuff and I'm totally stuck. Any help is appreciated.

 

This is my working script before my botched attempt at getting the above to work…

 

var myItems = app.project.selection;

// Create comp
var myComp = app.project.items.addComp("COMP_v01",1920,1080,1,60,24);

// Put comp in the same folder as the selected footage
myComp.parentFolder = myItems[0].parentFolder;

// Reverse 'for loop', so that the numerical layer names are listed correctly 00-99
for (var i = myItems.length-1; i >= 0; i--) {

   var myItem = myItems[i];
   
   // Add selected footage
   myComp.layers.add(myItem);
}

// Deselects all footage in the Project window
for (var i = 0; i < myItems.length; i++)
   myItems[i].selected = false;

// Selects the new comp
myComp.selected = true;

// Open comp
myComp.openInViewer();

 

 

var myFolder = app.project.items.addFolder(“Footage”);

myFolder.parentFolder = myItems[0].parentFolder;

 

in for loop:

myItems[i].parentFolder = myFolder;

TOPICS
Scripting

Views

20

Likes

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

Looking for a way to move footage files into a subfolder using scripting

Participant ,
Nov 16, 2020

Copy link to clipboard

Copied

I have a script that gets the selected footage items in the project window and adds it all to a new comp in the same folder as the footage. However, I want to improve this by then taking the selected footage, creating a folder named "Footage" at the same level as the comp, ie - not root, and moving the selected footage into it. The comp will stay where it is. The final folder hierarchy should look like this…

 

ROOT
    Folder
        COMP_v01
        Footage folder
            FootageA
            FootageB
            FootageC
            etc

 

 

I found this possible starting point on Creative Cow, but I can't figure out how to integrate its approach into my script. Sorry, I'm quite new at this… https://creativecow.net/forums/thread/script-to-create-folder-and-move-footage-within-ae

 

I'm getting lost with the parentFolder stuff and I'm totally stuck. Any help is appreciated.

 

This is my working script before my botched attempt at getting the above to work…

 

var myItems = app.project.selection;

// Create comp
var myComp = app.project.items.addComp("COMP_v01",1920,1080,1,60,24);

// Put comp in the same folder as the selected footage
myComp.parentFolder = myItems[0].parentFolder;

// Reverse 'for loop', so that the numerical layer names are listed correctly 00-99
for (var i = myItems.length-1; i >= 0; i--) {

   var myItem = myItems[i];
   
   // Add selected footage
   myComp.layers.add(myItem);
}

// Deselects all footage in the Project window
for (var i = 0; i < myItems.length; i++)
   myItems[i].selected = false;

// Selects the new comp
myComp.selected = true;

// Open comp
myComp.openInViewer();

 

 

var myFolder = app.project.items.addFolder(“Footage”);

myFolder.parentFolder = myItems[0].parentFolder;

 

in for loop:

myItems[i].parentFolder = myFolder;

TOPICS
Scripting

Views

21

Likes

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
Nov 16, 2020 0
Engaged ,
Nov 17, 2020

Copy link to clipboard

Copied

var myFolder = app.project.items.addFolder(“Footage”);

myFolder.parentFolder = myItems[0].parentFolder;

 

in for loop:

myItems[i].parentFolder = myFolder;

Likes

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
Reply
Loading...
Nov 17, 2020 1
Participant ,
Nov 17, 2020

Copy link to clipboard

Copied

*chef kiss*. Thanks again Paul, just what I was looking for.

Likes

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
Reply
Loading...
Nov 17, 2020 0