If you’re someone who uses Adobe Premiere Pro or other Adobe products like After Effects, Illustrator, and Photoshop, you might find yourself performing repetitive tasks that could benefit from automation. Fortunately, most Adobe products offer a way to automate tasks with some basic scripting experience. The ExtendScript Developer Tools can help you automate these tasks and even create your own extensions.

In this article, we’ll take a closer look at how you can use the ExtendScript Developer Tools to automate tasks in Adobe Premiere Pro. We’ll assume that you have some basic knowledge of scripting, but no experience with ExtendScript or Premiere Pro scripting is necessary.

To get started, you’ll need to have the ExtendScript Developer Tools installed. If you don’t have it yet, you can download the extension from Adobe Exchange. Once you have it installed, open the ExtendScript Developer Tools and enter “app” in the console. This will give you access to the application object, which is usually your entry point if you don’t know where to start.

Next, we’ll inspect the application object by clicking on the small magnifying glass that appears in the console. In the inspect tab, you’ll see all the things you have access to using the ExtendScript Developer Tools. In this case, we want to modify the currently selected clip in the timeline. Even if you don’t know how to access the clip, the project property is usually a good place to start since the clip is part of a project. Therefore, we’ll expand the project property to find the activeSequence property. The active sequence object represents your timeline and it gives us access to a lot of properties, such as the sequence’s name and resolution, as well as several methods that allow us to interact with the sequence. One of these methods is the getSelection method, which returns a list of clips. As you can see in the console, the method returns one element if only one clip is selected and several if more than one clip is selected in the timeline.

Now that we have access to the selected clips, we can modify the name of the first clip in our selection. We can easily test the command in our console by clicking on the small arrow next to the name. This also allows us to copy both the command and the result of the command to the clipboard. Next, we’ll give a new name to the clip by assigning it a new value.

You’ll see that after sending this command the name of the clip changed. And this is just the beginning of what you can do with the ExtendScript Developer Tools. The extension also shows properties and methods which are not part of the official documentation, which gives you even more flexibility. Learn more about hidden functionalities in this article:

The ExtendScript Developer Tools also includes a small code editor. Let’s have a look at this feature:

We’ll write a small script that disables all clips in our selection that have .mp4 in the name. As we previously renamed the first item, all other clips should still have .mp4 in the name and become disabled if our script works.

Let’s start by storing the active selection in a variable called selection. Next, we’ll iterate over each item in the selection. As mentioned before, we’ll then check if the name contains .mp4, and if yes, we’ll disable the selected clip.

var selection = app.project.activeSequence.getSelection();

for (var i = 0; i < selection.legnth; i++) {
    var clip = selection[i];
    if (clip.name.includes(".mp4")) {
       clip.disabled = true;
    }
}

By clicking on the run button, we can test our script. As you can see, it successfully disabled every clip but the first one, which did not have .mp4 in its name.

Tags: