First off, Happy New Year to all.
I was wondering whether anyone could check out this short script for me. Its bizarre, and I can't tell whether its me or my machines - I have a bunch of somewhat flaky beta software on.
All it does is create two folders - 'comp' and 'footage' and loop through all the items in the project window and place them in the appropriate folder.
Unfortunately it always seems to leave one or more items hanging out in the project window and there seems to be no rhymn or reason to this.
clearOutput();
var newFolderF = app.project.items.addFolder("footage");
var newFolderC = app.project.items.addFolder("comps");
for(i = 1; i <= app.project.numItems; i++) {
if(app.project.item(i) instanceof FootageItem)
app.project.item(i).parentFolder = newFolderF;
if(app.project.item(i) instanceof CompItem)
app.project.item(i).parentFolder = newFolderC;
}
Thanks,
Stephen.
Huh ?
Moderator: Paul Tuersley
Hi slawes,
you could add a blank character to the folder names (" comps", " footages"), they should appear at the top of the project panel if items are sorted by Name.
You could also choose the "sort by Type" mode, or loop through the items until they've all been scanned...
you could add a blank character to the folder names (" comps", " footages"), they should appear at the top of the project panel if items are sorted by Name.
You could also choose the "sort by Type" mode, or loop through the items until they've all been scanned...
Great, thanks, I'll try that.
The strange thing I have found is that if I replicate this function two or three times within the same script - to try and loop through the items a few times to pick up the stragglers - it doesn't have any effect. However, if I run the above script a number of times after it has finished it does pick up the stragglers.
Why would this be different ? A bug perhaps ?
Frankly, it should do it the first time since all it is doing is looping through every item in the project and deciding whether its a comp or footage.
Thanks,
Stephen.
The strange thing I have found is that if I replicate this function two or three times within the same script - to try and loop through the items a few times to pick up the stragglers - it doesn't have any effect. However, if I run the above script a number of times after it has finished it does pick up the stragglers.
Why would this be different ? A bug perhaps ?
Frankly, it should do it the first time since all it is doing is looping through every item in the project and deciding whether its a comp or footage.
Thanks,
Stephen.