Set sequence name to a variable in Premiere Pro scripting

32 views Asked by At

Following the instructions, I managed to write a script that automates the encoding of the active sequence on Premiere Pro. It starts Media Encoder, uses the preset specified in the script and saves the new file in the specified location. All works well. However, I have one irritant... I have to write the output file name in the script every time. As I'm less familiar with JavaScript than other languages, I'd like to be able to save the sequence name in a variable so that my script can retrieve it to name the output file with the sequence name. Here's the script:

// premiere render sequence
    var project = app.project;
    var sequence = project.activeSequence;
    
    app.encoder.launchEncoder();
    
    //  SYNTAX
    //  app.encoder.encodeSequence(sequence, outputPath, presetPath, workArea, removeUponCompletion)
    
    app.encoder.encodeSequence(sequence, "/Users/martinjulien/Desktop/Encoded_Folder/filnename.mp4", "/Users/martinjulien/Documents/Adobe/Adobe\ Media\ Encoder\ \(Beta\)//24.0/Presets/Max_2.5GB_lower.epr", 0, 1);
    
    app.encoder.startBatch();

the 0 means to encode the entire sequence the 1 means job will be removed once complete

in that line: "/Users/martinjulien/Desktop/Encoded_Folder/filnename.mp4"

I'd like to replace filename with a variable containing the name of the original sequence.

0

There are 0 answers