Remove unused solids from your project
Posted: June 1st, 2004, 11:48 am
This script will go through your project, find any item that is a solid, make sure it isn't used, and delete it.
It doesn't affect footage items.
{
// Go backwards through all the items in the project
// Go backwards because we'll be deleting items from the list.
for (i = app.project.numItems; i >= 1; i--) {
var cur_item = app.project.item(i);
if (cur_item.typeName == "Footage" &&
cur_item.mainSource instanceof SolidSource) {
// The item is a solid.
var comps_using_item = cur_item.usedIn;
if (comps_using_item.length == 0) {
// The Solid is not used in any comps. Remove it.
cur_item.remove();
}
}
}
}
-------
Project before the script :

And after

It doesn't affect footage items.
{
// Go backwards through all the items in the project
// Go backwards because we'll be deleting items from the list.
for (i = app.project.numItems; i >= 1; i--) {
var cur_item = app.project.item(i);
if (cur_item.typeName == "Footage" &&
cur_item.mainSource instanceof SolidSource) {
// The item is a solid.
var comps_using_item = cur_item.usedIn;
if (comps_using_item.length == 0) {
// The Solid is not used in any comps. Remove it.
cur_item.remove();
}
}
}
}
-------
Project before the script :

And after
