Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Save 1st frame from each layer on my timeline as a jpg file?

  • Save 1st frame from each layer on my timeline as a jpg file?

    Posted by Adam Lewen on January 17, 2023 at 1:44 pm

    Hey there forum
    I am in need for a script that will automatically save a jpg from the 1st frame of each of my 200 layers…
    I have many layers and I want the script to save a tedious task.
    I have asked chatGPT to help, but the script does not execute (it’s not a “permissions” issue)
    Does anyone know what is not right here?
    ——-

    var comp = app.project.activeItem;

    var layers = comp.layers;

    var folder = Folder.selectDialog(“Choose the folder to save the images:”);

    if (folder != null) {

    for (var i = 1; i <= layers.length; i++) {

    var layer = layers[i];

    if (layer.canSetTime && layer.source) {

    var time = layer.inPoint;

    var file = new File(folder.fsName + “/” + layer.name + “.jpg”);

    var opts = new ExportOptionsSaveForWeb();

    opts.format = SaveDocumentType.JPEG;

    opts.quality = 100;

    layer.source.saveFrameToFile(file, time, opts);

    }

    }

    }
    ——–

    Thank you all.

    Manuel Moellmann replied 3 years, 4 months ago 2 Members · 1 Reply
  • 1 Reply

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