• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Script randomly launches Extend Script Toolkit

Guest
May 29, 2019 May 29, 2019

Copy link to clipboard

Copied

Hi

I have a random error whereby my script runs fine but always additionally launches the Extendscript toolkit. Wondered if someone could have a look through my code and maybe suggest a fix? It's a simple script that automatically generates a guide layer and applies a preset.

var newAdj = this;

    var activeComp = app.project.activeItem;

    if (activeComp instanceof CompItem) {

        var newAdj = activeComp.layers.addSolid([1,1,1], "OCIO", activeComp.width, activeComp.height, activeComp.pixelAspect, activeComp.duration);

        newAdj.label = 5;

        newAdj.adjustmentLayer = true;

        newAdj.guideLayer = true;

}

else {

    alert("Select Comp to apply OCIO.");

}

var main = function() {

  var proj = app.project;

  var presetfilepath = "/C/Program Files/Adobe/Adobe After Effects CC 2018/Support Files/Presets/ocio_apply.ffx"

  var pfile = File(presetfilepath);

  if (pfile.exists !== true) {

    alert('Preset file does not exist');

    return;

  }

  app.beginUndoGroup('apply preset');

  for (var i = 0; i < proj.selection.length; i++) {

    var item = proj.selection;

    if (item instanceof CompItem) {

      var layer = item.layers[1];

      $.writeln(layer.name);

      layer.applyPreset(pfile);

    }

  }

  app.endUndoGroup();

  return 0;

};

var run = function(f) {

  return f();

};

run(main);

Many thanks

TOPICS
Scripting

Views

598

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , May 29, 2019 May 29, 2019

You need to comment out or remove the line:

$.writeln(layer.name);

It opens the ESTK so it can write that in the console.

Votes

Translate

Translate
Enthusiast ,
May 29, 2019 May 29, 2019

Copy link to clipboard

Copied

You need to comment out or remove the line:

$.writeln(layer.name);

It opens the ESTK so it can write that in the console.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 29, 2019 May 29, 2019

Copy link to clipboard

Copied

LATEST

Yes that was it!

Thank you so much Paul - and for a such a quick response. Much appreciated.

Cheers

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines