Copy link to clipboard
Copied
A new trackItem property - disabled - will be added in the next release, and is available for testing now in Beta version 22.0.0 build 130 and later. It allows for adding a boolean value to clip > enable, effectively allowing the API to flip the clip enable UI switch:
Once V22 ships, this will be fully documented in the Premiere Pro Scripting Guide, and a new button will be added to the Premiere Pro Sample Panel (SDK) , which will look a lot like this:
Code sample is below
enableAllDisabledClips : function () {
var sequence = app.project.activeSequence;
if (sequence) {
var trackGroups = [sequence.audioTracks, sequence.videoTracks];
var trackGroupNames = ["audioTracks", "videoTracks"];
var updateUI = true;
for (var groupIndex = 0; groupIndex < 2; groupIndex++) {
$._PPP_.updateEventPanel(trackGroupNames[groupIndex]);
var group = trackGroups[groupIndex];
for (var trackIndex = 0; trackIndex < group.numTracks; trackIndex++) {
var track = group[trackIndex];
var clips = track.clips;
var transitions = track.transitions;
var beforeSelected;
var afterSelected;
var initialSelectState;
$._PPP_.updateEventPanel("track:" + trackIndex + " clip count: " + clips.numItems + " transition count: " + transitions.numItems);
for (var clipIndex = 0; clipIndex < clips.numItems; clipIndex++) {
var clip = clips[clipIndex];
var name = (clip.projectItem === undefined ? "<null>":clip.projectItem.name);
if (clip.disabled === true){ //using new trackItem property named disabled
clip.disabled = false;
$._PPP_.updateEventPanel("clip:" + clipIndex + " , " + name + " was disabled, is now enabled " );
}
}
}
}
} else {
$._PPP_.updateEventPanel("no active sequence.");
}
},
Have something to add?