This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Registers all possible keystrokes for Adobe CEP panels on Windows and Mac | |
| function keyRegisterOverride() { | |
| var os = navigator.platform.substr(0, 3); | |
| var maxKey; | |
| if (os === 'Mac') { | |
| maxKey = 126; // Mac Max Key Codes | |
| } | |
| else if (os === 'Win') { | |
| maxKey = 222; // HTML Max Key Codes | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getPrMetadata(projectItem, fieldNames) { | |
| var kPProPrivateProjectMetadataURI ="http://ns.adobe.com/premierePrivateProjectMetaData/1.0/"; | |
| if (app.isDocumentOpen()) { | |
| if (projectItem) { | |
| if (ExternalObject.AdobeXMPScript === undefined) | |
| ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript"); | |
| if (ExternalObject.AdobeXMPScript !== undefined) { | |
| var retArray = []; | |
| var retArray2 = []; | |
| var projectMetadata = projectItem.getProjectMetadata(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Adds clips selected in Project Panel to active sequence at their timecode and trims the start of the sequence so timecode is aligned | |
| var viewIDs = app.getProjectViewIDs(); | |
| var firstClipTime = null; | |
| var clips = []; | |
| // Loop through and identify all selected items | |
| for (var a = 0; a < app.projects.numProjects; a++) { | |
| var currentProject = app.getProjectFromViewID(viewIDs[a]); | |
| if (currentProject) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Toggles transfer mode between Difference and Normal | |
| var DIFFERENCE = 5; | |
| var NORMAL = 18; | |
| var selection = app.project.activeSequence.getSelection(); | |
| try { | |
| for (var i = 0; i < selection.length; i++) { | |
| var item = selection[i]; | |
| if(item.mediaType == 'Video'){ | |
| var prop = item.components[0].properties[1]; | |
| if(prop.getValue() === DIFFERENCE){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var sequence = app.project.activeSequence, | |
| trackGroups = [sequence.audioTracks, sequence.videoTracks]; | |
| for (i = 0; i < trackGroups.length; i++) { | |
| var trackCount = trackGroups[i].numTracks; | |
| for (j = 0; j < trackCount; j++) { | |
| var clipCount = trackGroups[i][j].clips.numItems; | |
| for (k = 0; k < clipCount; k++) { | |
| var clip = trackGroups[i][j].clips[k]; | |
| if (clip.isSelected()) { | |
| // do stuff with clip.name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function setPrMetadata(projectItem, metadata) { | |
| var kPProPrivateProjectMetadataURI = "http://ns.adobe.com/premierePrivateProjectMetaData/1.0/"; | |
| if (app.isDocumentOpen() && projectItem) { | |
| if (ExternalObject.AdobeXMPScript === undefined) | |
| ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript'); | |
| if (ExternalObject.AdobeXMPScript !== undefined) { | |
| var projectMetadata = projectItem.getProjectMetadata(); | |
| var xmp = new XMPMeta(projectMetadata); | |
| for (var pc = 0; pc < metadata.length; pc++) { | |
| var successfullyAdded = app.project.addPropertyToProjectMetadataSchema(metadata[pc][0], metadata[pc][1], 2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Gets all properties with keyframes in a layer | |
| function getPropsWithKeys(layer) { | |
| var numRootProps = layer.numProperties; | |
| var propsWithKeys = []; | |
| for (var i = 0; i < numRootProps; i++) { | |
| var prop = layer(i + 1); | |
| var isGroup = prop.numProperties && prop.numProperties > 0; | |
| if (isGroup) { | |
| for (var j = 0; j < prop.numProperties; j++) { | |
| var subProp = prop.property(j + 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Gets the parent bin of a project item | |
| // Example: getParentBin(app.project.activeSequence.projectItem, app.project.rootItem) | |
| function getParentBin(item, base){ | |
| var path = item.treePath; | |
| for(var i = 0; i < base.children.numItems; i++){ | |
| if(base.children[i].type == ProjectItemType.BIN){ | |
| var foundItem = getParent(item, base.children[i]); | |
| if(foundItem){ | |
| return foundItem; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Apply Warp Stabilizer to first layer in all selected comps | |
| for (i = 0; i < app.project.selection.length; i++) { | |
| app.project.selection[i].layers[1].Effects.addProperty('Warp Stabilizer'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Sets colorspace of selected footage to REDLogFilm | |
| for (var selection, viewIDs = app.getProjectViewIDs(), i = 0; i < viewIDs.length; i++) | |
| if (app.getProjectFromViewID(viewIDs[i]).name == app.project.name) { | |
| selection = app.getProjectViewSelection(viewIDs[i]); | |
| break | |
| } | |
| for (i = 0; i < selection.length;i++){ | |
| var item = selection[i]; | |
| // item.videoComponents[0].properties[25].setValue(1); // set to REDgamma3 |