Hi Guys,
Since I'm new to extendscript, I'm still having some trouble with it, maybe you guys can help. I have a sequence with a lot of short clips in it and I want to export the clips separately. Up till now I've always nested all the clips after editing them and then exported the nested sequences. But since it's for a recurring client, I've been trying to automate this proces with a script to make it easier.
What I'm doing: I made a script that sets the in/out point of the sequence and sends it to media encoder. It iterates through all the clips in the sequence and does this for every one of them, so essentially I'm exporting the same sequence, but with different in/out points. Everything appears to work just fine, I get a bunch of clips in my render queue with the right names. The problem is, that the in/out point for every clip is the same.
This is what I got so far:
app.enableQE(); var actSeq = app.project.activeSequence; if (actSeq) { var seqName = actSeq.name; var actTrack = actSeq.videoTracks[0]; var clipCount = actTrack.clips.numItems; //app.encoder.launchEncoder(); var outPreset = new File(outputPresetPath); var outputPresetPath = "~/Documents/Adobe/Adobe%20Media%20Encoder/12.0/Presets/480x270%2016-9%20LowRes.epr"; var outputPath = Folder.selectDialog("Kies Export Folder"); var activeSequence = qe.project.getActiveSequence(); var i; for (i=0; i<clipCount; i++){ var actClip = actTrack.clips[i]; var clipInPoint = actClip.start; var clipOutPoint = actClip.end; actSeq.setInPoint(clipInPoint); actSeq.setOutPoint(clipOutPoint); var clipName = actClip.name.split(".").shift(); var outputFormatExtension = activeSequence.getExportFileExtension(outPreset.fsName); var fullPathToFile = outputPath.fsName + "/" + clipName + "." + outputFormatExtension; var outFileTest = new File(fullPathToFile); var jobID = app.encoder.encodeSequence(actSeq, fullPathToFile, outPreset.fsName, 1, 1); }; outPreset.close(); } else { alert("Geen actieve sequence. Selecteer er eerst één.") }
I can't figure out why it's going wrong, since everything else is working correctly.
Thanks!
[EDIT] BTW: if I iterate manually, by just changing the i variable into a number, it works perfectly fine.