diff --git a/jsx/applynewlength.jsx b/jsx/applynewlength.jsx index 144f372..dbc6675 100644 --- a/jsx/applynewlength.jsx +++ b/jsx/applynewlength.jsx @@ -1 +1 @@ -/* TO DO Only change lengths of layers whose endpoint is greater or equal to the old comp end point. */ function getSelectedProjectItems (){ var items = []; var p = app.project; for ( var i = 1 ; i <= p.numItems ; i ++ ){ var item = p.item(i); if ( item.selected ){ items.push(item); } } return items; } function applyNewLength( comp , newLength){ comp.duration = newLength; for ( var i = 1; i <= comp.layers.length ; i ++){ if (!comp.layers[i].locked){ comp.layers[i].outPoint = newLength; }else{ comp.layers[i].locked = false; comp.layers[i].outPoint = newLength; comp.layers[i].locked = true; } } } itms = getSelectedProjectItems(); for ( var i = 0; i < itms.length ; i ++){ applyNewLength( itms[i] , 60); } \ No newline at end of file +/* TO DO Only change lengths of layers whose endpoint is greater or equal to the old comp end point. */ function getSelectedProjectItems (){ var items = []; var p = app.project; for ( var i = 1 ; i <= p.numItems ; i ++ ){ var item = p.item(i); if ( item.selected ){ items.push(item); } } return items; } function applyNewLength( comp , newLength){ comp.duration = newLength; for ( var i = 1; i <= comp.layers.length ; i ++){ if (!comp.layers[i].locked){ comp.layers[i].outPoint = newLength; }else{ comp.layers[i].locked = false; comp.layers[i].outPoint = newLength; comp.layers[i].locked = true; } } } function applyNewFramerate( comp , newFrameRate){ comp.frameRate = newFrameRate; } itms = getSelectedProjectItems(); for ( var i = 0; i < itms.length ; i ++){ // applyNewFramerate( itms[i] , 29.97); applyNewLength( itms[i] ,120); } \ No newline at end of file diff --git a/jsx/match_audio_of_containing_comp.jsx b/jsx/match_audio_of_containing_comp.jsx new file mode 100644 index 0000000..49dbaf0 --- /dev/null +++ b/jsx/match_audio_of_containing_comp.jsx @@ -0,0 +1,4 @@ +//expresion to match the audio of the layer to an audio of a layer in a comp that contains this comp. +my_comp = comp("COMPNAME"); +my_layer = my_comp.layer(thisComp.name); +my_layer.inPoint + time