Forum Replies Created

Viewing 11 - 20 of 43 posts
  • Avinash Ramanath

    February 2, 2019 at 4:14 pm

    Hi,
    Sorry if I have been unclear. Here’s what am trying to do.

    1. create a folder called CNM
    2. iterate trough project items
    3. if a comp with name CNM_ found, then move it to folder CNM

    but every time I run the script below, folder CNM is duplicated

    I don’t want to duplicate if CNM is already present.

    //app.project.items.addFolder("CNM");
    for (var i = 1; i <= app.project.numItems; i++) {
    var cItem = app.project.item(i);
    if ((cItem instanceof FolderItem) && (cItem.name == "CNM")) { var fCompositions = cItem; }
    }

    function getCompositions() {
    var allComps = new Array();
    if (app.project != null) {
    var items = app.project.items;
    for (var i = 1; i <= items.length; i++)
    if ((items[i] instanceof CompItem) && (items[i].name.substring(0, 4) === "CNM_")) {
    allComps[allComps.length] = items[i];
    }
    }
    return allComps;
    }
    var comps = getCompositions();
    for (var i = 0; i < comps.length; i++) {
    comp = comps[i];
    comp.parentFolder = fCompositions;
    }

  • Avinash Ramanath

    December 18, 2018 at 9:01 am

    Yup, I just realized that. How about you input text first and then cut.

  • Avinash Ramanath

    December 18, 2018 at 5:06 am

    I have a workaround. MGRT layers are like any other layers so you can cut the layer after in animation, before out animation and repeat it.

  • Avinash Ramanath

    September 22, 2018 at 6:13 pm

    Yes Dan, it works fine now. Thanks to you James Ronan. I have learned a new thing now.

  • Avinash Ramanath

    September 22, 2018 at 6:01 pm

    Dan, could you please modify the script for me.

  • Avinash Ramanath

    September 22, 2018 at 4:39 pm

    The wrong image uploaded in the previous post. Please see this one.

  • Avinash Ramanath

    September 22, 2018 at 4:38 pm

    I don’t know what am doing wrong here, must be in the for loop. The script seems to be selecting files with odd number names and only placing those inside the Assets folder. Please check the image to understand my problem,

    // Select folder to import
    var targetFolder = Folder.selectDialog("Import Files From Folder");
    if (targetFolder)
    {
    var files = targetFolder.getFiles();
    for (var i = 0; i < files.length; i++)
    {
    try
    {
    var importOptions = new ImportOptions(files[i]);
    app.project.importFile(importOptions);
    }
    catch (error)
    { /*alert(error.toString());*/ }
    }
    }
    //create Assets folder
    var compFolder = app.project.items.addFolder("Assets");
    //collect items and move to Assets folder
    var files = app.project.items.length;
    for (var i = 1; i <= files; i++)
    {
    if (app.project.item(i).hasVideo == true && app.project.item(i).hasAudio == false && app.project.item(i).duration == 0)
    { // Check if Video or image
    app.project.item(i).parentFolder = compFolder;
    }
    else
    if (app.project.item(i).hasVideo == true && app.project.item(i).hasAudio == true && app.project.item(i).duration !== 0)
    { // Check if Video or image
    app.project.item(i).parentFolder = compFolder;
    }
    }

  • Avinash Ramanath

    September 21, 2018 at 5:37 pm

    screenshot2018-09-21at11.05.21pm.png

    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 i = 0; i < mySelectedItems.length; i++){
    var mySelection = mySelectedItems[i];

    // var myComp = app.project.items.addComp(mySelection.name, 1920, 1080, 1, mySelection.duration, 24);

    if (mySelectedItems[i].isStill){
    var myComp = app.project.items.addComp(mySelection.name, 1920, 1080, 1, 4, 24);
    }else{
    var myComp = app.project.items.addComp(mySelection.name, 1920, 1080, 1, mySelection.duration, 24);
    }

    var myLayer = myComp.layers.add(mySelection);
    var myTransform = myLayer.Effects.addProperty("Transform");
    myTransform.property(4).setValue(150);
    }

  • Avinash Ramanath

    September 21, 2018 at 5:00 pm

    Unable to execute script at line 12. After Effect error: Unable to call “addComp” because of parameter 1. Value is undefined.

  • Avinash Ramanath

    September 21, 2018 at 4:48 pm

    I’m getting this Error Dan. Please help.

    for (var i = 1; i <= app.project.numItems; i++)

    {
    if (app.project.item(i).selected)
    mySelectedItems[mySelectedItems.length] = app.project.item(i);
    }
    for (var i = 0; i < mySelectedItems.length; i++)
    {

    if (mySelectedItems[i].isStill){
    var myComp = app.project.items.addComp(mySelection.name, 1920, 1080, 1, 4, 24);
    }else{
    var myComp = app.project.items.addComp(mySelection.name, 1920, 1080, 1, mySelection.duration, 24);
    }

    var myLayer = myComp.layers.add(mySelection);
    }

Viewing 11 - 20 of 43 posts

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy