Skip to main content
Participant
March 28, 2019
Question

How to bypass AutoTrace message in AE?

  • March 28, 2019
  • 1 reply
  • 387 views

I have a script. Which automates the auto track feature.

Applying this script comes a message(link https://ibb.co/YP6yGCc ). I do not want this message to come.

How is it possible? Please help me:)

/*

AutoTrace and copy Masks from Layer Above.jsx

By Lloyd Alvarez https://aescripts.com/

Selects the layer above

Invokes Auto-Trace...

Copies the masks to the layer below

Deletes the layer above

*/

try{

    app.beginUndoGroup("Auto-trace and copy masks from Layer Above");

    var myComp = app.project.activeItem;

    var myLayer = myComp.selectedLayers[0];

    var layerAbove = myComp.layer(myLayer.index-1);

    layerAbove.selected = true;

    myLayer.selected = false;

    app.executeCommand(app.findMenuCommandId("Auto-trace..."));

   

    for (var j=1; j<= layerAbove.property("Masks").numProperties; j++) { //loop through the parent properties

        if (layerAbove.property("Masks").property(j).hasOwnProperty("Mask Path")) {

            var myPath = layerAbove.property("Masks").property(j).property("Mask Path");

            var myShape = myPath.value;

            var myNewMask = myLayer.property("Masks").addProperty("Mask");

            var myNewPath = myNewMask.property("Mask Path");

            myNewPath.setValue(myShape);

            }

        }

    layerAbove.remove();

    app.endUndoGroup();

    }

    catch (e) {

        alert(e.toString());

        }

This topic has been closed for replies.

1 reply

Tomas Sinkunas
Legend
March 28, 2019

You cannot run the script without showing this dialog box. That's just the way app.executeCommand(app.findMenuCommandId("Auto-trace...")); works - it simply executes a command in same as if you did it manually.