-
How to edit this script and make it link layers?
Hi,
I have this working script but I would like to change it. I guess that it would take 2 minutes to change it, but I don’t know how… I did manage to change the text on the buttons ???? hehe
The script has 2 buttons.
1. First, you select all the layers in the project and click the “First Button” to “grab it”
2. Then you select all the compositions in the project and click the “Second Button” to place all the layers from the first seletion to all the selected compositions.It’s working fine, but I need something else… ☺
I need this:
1. First, you select some layers in the active composition and click the “First Button” to “grab it”
2. Then you select another layers in the same composition and click the “Second Button” to link all the layers from “selection one” to “selection two”Is this a problem? I would change it but I don’t know how… I’ve been trying for hours… but it’s not working…
Please help me, if it’s not too much work… ☺ Thank you all!
var w = new Window ("palette", "Link");
w.add("button", undefined,"Selection 1",{name:"ok"}).onClick = function(){ SelFootage(); }
w.add("button", undefined,"Link To Selection 2",{name:"ok"}).onClick = function(){ SelComps(); }
w.show();
FootageList = new Array();
function SelFootage()
{
var mySelectedItems = [];
for (var i = 1; i <= app.project.numItems; i++)
{
if (app.project.item(i).selected)
mySelectedItems[mySelectedItems.length] = app.project.item(i);
}
for (var b = 0; b < mySelectedItems.length; b++)
{
var mySelection = mySelectedItems[b];
var myComp = app.project.items;
FootageList[FootageList.length] = mySelection;
}
}
function SelComps()
{
app.beginUndoGroup("Add To Comps");
var mySelectedItems = [];
for (var i = 1; i <= app.project.numItems; i++)
{
if (app.project.item(i).selected)
mySelectedItems[mySelectedItems.length] = app.project.item(i);
}
for (var b = 0; b < mySelectedItems.length; b++)
{
mySelectedItems[b].layers.add(FootageList[b]);
}
FootageList = []
app.endUndoGroup();
}