JS script stopped to work after upgrade to Premiere PRO 2020
Hi!
We have some custom scripts that speed up our pipeline. One of them do not work in Premiere 2020. It works perfect in previous versions of Premiere. What may be the reason? The window of script appears, it starts to work, but the main part - export of files do not occur. Here is the part of code:
function export_by_upper_track()
{
var proj = app.project;
message='export_by_upper_track';
app.setSDKEventMessage(message, 'info');
ver=app.version.substring(0,2);
//message="%USERPROFILE%"+"\\Documents\\Adobe\\Adobe Media Encoder\\"+ver+".0\\Presets"
epr_path=$.getenv('USERPROFILE')+"\\Documents\\Adobe\\Adobe Media Encoder\\"+ver+".0\\Presets\\prof.epr"
app.setSDKEventMessage(epr_path, 'info');
if (!app.project.rootItem) return "rootItem is not available";
{
var activeSequence = app.project.activeSequence;
if (activeSequence) {
var foundTarget = false;
var vTrack = activeSequence.videoTracks[activeSequence.videoTracks.numTracks-1];
}
clips=vTrack.clips.numItems
message='clips'+clips;
app.setSDKEventMessage(message, 'info');
outPreset = new File(epr_path);
var format_ext=activeSequence.getExportFileExtension(outPreset.fsName);
message='ext='+format_ext;
app.setSDKEventMessage(message, 'info');
var outputPath = Folder.selectDialog("Choose the output directory");
// The code works OK up to this line - then nothing happened, the value of var clip is correct
for (var i = 0; i < clips; i++) {
start=vTrack.clips[i].start;
end=vTrack.clips[i].end;
message=start;
app.setSDKEventMessage(message, 'info');
message=end;
app.setSDKEventMessage(message, 'info');
activeSequence.setInPoint(start);
activeSequence.setOutPoint(end);
name=outputPath.fsName+"\\"+vTrack.clips[i].name+"."+format_ext;
message=name;
app.setSDKEventMessage(message, 'info');
activeSequence.exportAsMediaDirect(name, epr_path, app.encoder.ENCODE_IN_TO_OUT)
}
}
}