6 Replies Latest reply on Feb 10, 2016 10:20 AM by Bruce Bullis

    How do I add imported files into sequences using Premiere Pro's ExtendScript connection?

    tjgreen0 Level 1

      Really want to know the answer to this.... I'm trying to create a script (in ExtendScript for Premiere Pro) that will load in specified video files, clip them at specified start and stop times, place them into a sequence, and then export the resulting movie.

      I understand that Adobe doesn't have official documentation about scripting for Premiere Pro, so I've been working from the data browser (in the ExtendScript Toolkit, or ESTK) and a collection of handy references I've found at links like this:

      http://webcache.googleusercontent.com/search?q=cache:http://cssdk.adobesites.com/sdk/2.1/d ocs/WebHelp/references/csawlib/com/adobe/premiere/App.html

      (You can replace the "App" there with other class names, but they always have to be correctly capitalized, like "Project" or "TrackCollection". The pages list properties and methods for the classes, and are the only place I've been able to find what kind of parameters/arguments the methods expect.)

      I have successfully loaded in the CSV file that specifies the needed info. I also know how to import the video files and create a new sequence (as explained here: http://forums.adobe.com/thread/1177191). The trouble I'm having now is getting the imported files clipped correctly and placed into the sequence. (I see that the activeSequence has methods like setInPoint and setOutPoint, but that doesn't seem to result in the correct trimming upon export.)

      Here is my code (with comments to show flow of overall script):

      #target premierepro var myDir = "G:\\directoryWithVideoFiles\\"; // defined "indexOf" subfunction here // ***** begin main body of script ***** // (dataRuns has fields runName, startVideo, startTime, stopVideo, stopTime) // Import video files listed in dataRuns var vidFiles = new Array; for (i=0; i<dataRuns.length; i++) { if (indexOf.call(vidFiles,myDir + dataRuns[i].startVideo + '.MPG') == -1) { vidFiles.push(myDir + dataRuns[i].startVideo + '.MPG'); } if (indexOf.call(vidFiles,myDir + dataRuns[i].stopVideo + '.MPG') == -1) { vidFiles.push(myDir + dataRuns[i].stopVideo + '.MPG'); } app.project.createNewSequence(dataRuns[i].runName,''); } app.project.importFiles(vidFiles); // at this point, for each run (called runName) I need to: // - take a clip of the startVideo from the startTime to the end of the video // - take a clip of the stopVideo from the start of the video to the stopTime // - put clip 1 at the beginning of the associated sequence, & clip 2 right after // - export the sequence as a new video file

        This content has been marked as final.  Show 6 replies