Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions AFX Script Problem Visual Studio Code

  • AFX Script Problem Visual Studio Code

  • Martin Müller

    July 14, 2021 at 7:10 pm

    Hi,

    i recently started scripting and wrote a script in VS Studio for After Effects, which works fine when i run it from Visual Studio. But when i save it and run the script from After Effect it gives me an error message: “unable to execute at line 20…”

    which is a function in my script. everything before gets executed.

    I have Variables (a,b) in my function because i am looking for several Objects meaning CompItem, FootageItem, Folderitem where I’m looking for specific names as a string.

    The Function looks like that:

    function graballItems (a,b){

    var proj,curItem,itemTotal,ItemAry;

    proj = app.project;

    itemTotal = proj.numItems;

    ItemAry = new Array();

    for (var i =1; i<= itemTotal; i++){

    curItem = proj.item(i);

    if (curItem instanceof b && curItem.name.indexOf(a) !== -1 ){

    ItemAry = curItem;

    }

    }

    return ItemAry;

    }

    And i use it like that:

    var myCompBeauty = graballItems(“CAN_ENDTAG_PRE”,CompItem);

    But strange though, that it is working from VS Studio.

    Does anybody know why the error message appears?

    Cheers

    Martin

  • Tomas Bumbulevičius

    July 21, 2021 at 8:44 pm

    Hey Martin, it would be better if you share specifically a line 20 (to know where error is coming at) and all lines above which are related.

    In addition, please share whole error message – as now its truncated and might point out to the problem by itself.

Viewing 1 - 2 of 2 posts

Log in to reply.

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