### Get Learn Panel Example Project Directory Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/application/application.md Retrieves the directory path for the Learn panel's example projects. This path is read-only. ```javascript app.learnPanelExampleProjectDirPath; // /Users/Shared/Adobe/Premiere Pro/14.0/Tutorial/Going Home project/ ``` -------------------------------- ### app.learnPanelExampleProjectDirPath Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/application/application.md Retrieves the directory path for the Learn panel's example projects. ```APIDOC ### app.learnPanelExampleProjectDirPath `app.learnPanelExampleProjectDirPath` #### Description Get the Learn panel's example projects directory path. #### Type String; read-only. #### Example Get a path to a Learn panel's example projects' directory ```js app.learnPanelExampleProjectDirPath; // /Users/Shared/Adobe/Premiere Pro/14.0/Tutorial/Going Home project/ ``` ``` -------------------------------- ### ProjectItem.startTime() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/item/projectitem.md Returns a Time object representing the start time of the project item. ```APIDOC ## ProjectItem.startTime() ### Description Returns a [Time object](../other/time.md), representing start time. ### Method `startTime` ### Endpoint `app.project.rootItem.children[index].startTime()` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response [Time object](../other/time.md). #### Response Example None ``` -------------------------------- ### ProjectItem.setStartTime() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/item/projectitem.md Assigns a new start time to the project item. ```APIDOC ## ProjectItem.setStartTime() ### Description Assigns a new start time to the project item ### Method `setStartTime` ### Endpoint `app.project.rootItem.children[index].setStartTime(time)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (0) Returns `0` if successful. #### Response Example None ``` -------------------------------- ### SourceMonitor.play() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/general/sourcemonitor.md Starts playback in the Source monitor at a specified speed. ```APIDOC ## SourceMonitor.play(playbackSpeed) `app.sourceMonitor.play(playbackSpeed)` ### Description Begins playing back the Source monitor, at the specified playback speed. ### Method JavaScript ### Endpoint app.sourceMonitor.play(playbackSpeed) ### Parameters #### Path Parameters None. #### Query Parameters None. #### Request Body None. ### Parameters - **playbackSpeed** (Float) - Required - The playback speed. ### Request Example ```javascript // Play at normal speed (e.g., 1.0) app.sourceMonitor.play(1.0); // Play at half speed app.sourceMonitor.play(0.5); ``` ### Returns - **integer** - Returns `0` if successful. ``` -------------------------------- ### Work with In/Out Points Source: https://context7.com/docsforadobe/premiere-scripting-guide/llms.txt Demonstrates setting, getting, and clearing in and out points for project items. Time is specified in seconds, and the second parameter indicates the media type. Use this for defining clip ranges. ```javascript // Work with in/out points item.setInPoint(5.0, 4); // 5 seconds, all media types item.setOutPoint(15.0, 4); var inPoint = item.getInPoint(); var outPoint = item.getOutPoint(); item.clearInPoint(); item.clearOutPoint(); ``` -------------------------------- ### Access Application Properties and Settings Source: https://context7.com/docsforadobe/premiere-scripting-guide/llms.txt Use the global `app` object to get application version, build, check for open projects, manage workspaces, access preference paths, and write messages to the Events panel. It also covers setting scratch disk paths and proxy usage. ```javascript // Get application version and build information var version = app.version; // "14.3.1" var build = parseInt(app.build); // 45 // Check if any project is currently open if (app.isDocumentOpen()) { var project = app.project; alert('Current project: ' + project.name); } // Get and set workspaces var workspaces = app.getWorkspaces(); // ["All Panels", "Assembly", "Audio", "Color", "Editing", "Effects", "Graphics", "Learning", "Libraries", "Metalogging", "Production"] app.setWorkspace('Editing'); // Access preference paths var prefPath = app.getAppPrefPath; // "/Users/USERNAME/Documents/Adobe/Premiere Pro/14.0/Profile-USERNAME/" // Write messages to Events panel app.setSDKEventMessage('Script started successfully', 'info'); app.setSDKEventMessage('Warning: Missing media', 'warning'); app.setSDKEventMessage('Error occurred', 'error'); // Set scratch disk paths var scratchPath = Folder.selectDialog('Choose scratch disk folder'); if (scratchPath && scratchPath.exists) { app.setScratchDiskPath(scratchPath.fsName, ScratchDiskType.FirstAutoSaveFolder); } // Enable/disable proxy usage app.setEnableProxies(1); // Enable proxies var proxiesEnabled = app.getEnableProxies(); // Returns 1 if enabled // Bind to events var success = app.bind("onActiveSequenceStructureChanged", function() { alert('Sequence structure changed!'); }); ``` -------------------------------- ### Sequence.setZeroPoint() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/sequence/sequence.md Sets the starting time (zero point) of the sequence. ```APIDOC ## Sequence.setZeroPoint() ### Description Set the starting time of the sequence. ### Method Not specified (assumed to be a method call on a Sequence object) ### Endpoint Not applicable (scripting method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript sequence.setZeroPoint(newZeroPoint); ``` ### Response #### Success Response (200) Not specified. #### Response Example Not specified. ``` -------------------------------- ### Get System Preference Path Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/application/application.md Retrieves the path to Premiere Pro's active configuration files, which are not user-specific. This path is read-only. ```javascript app.getAppSystemPrefPath; // /Library/Application Support/Adobe/Adobe Premiere Pro 2020/ ``` -------------------------------- ### Get Learn Panel Content Directory Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/application/application.md Returns the directory path for the Learn panel's content files. This path is read-only. ```javascript app.learnPanelContentDirPath; // /Users/Shared/Adobe/Premiere Pro 2020/Learn Panel/ ``` -------------------------------- ### Get Application Executable Path Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/application/application.md Returns the file path to the Premiere Pro executable. This path is read-only. ```javascript app.path; // /Applications/Adobe Premiere Pro 2020/Adobe Premiere Pro 2020.app/ ``` -------------------------------- ### Get Available Workspaces Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/application/application.md Obtains a list of all available workspaces in Premiere Pro. This can be useful for understanding the UI layout options. ```javascript app.getWorkspaces(); /* [ "All Panels", "Assembly", "Audio", "Color", "Editing", "Effects", "Graphics", "Learning", "Libraries", "Metalogging", "Production" ]; */ ``` -------------------------------- ### Get Premiere Pro System Preference Path Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/application/application.md Retrieves the path to Premiere Pro's active configuration files, which are not user-specific. This path is read-only. ```javascript app.getPProSystemPrefPath; // /Library/Application Support/Adobe/Adobe Premiere Pro 2020/ ``` -------------------------------- ### Marker Object Attributes Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/general/marker.md This section covers the various attributes of the Marker object, including comments, start and end times, GUID, name, and type. ```APIDOC ## Marker Object Attributes ### Marker.comments `app.project.activeSequence.markers.getFirstMarker().comments` `app.project.rootItem.children[index].getMarkers().getFirstMarker().comments` #### Description The comments within the marker. #### Type String; read/write. --- ### Marker.end `app.project.activeSequence.markers.getFirstMarker().end` `app.project.rootItem.children[index].getMarkers().getFirstMarker().end` #### Description A [Time object](../other/time.md) containing the value of the ending of the marker. NOTE: To set the time value for the end of a marker, pass a Seconds value, not a complete replacement ```Time```. #### Type [Time object](../other/time.md); read/write. --- ### Marker.guid `app.project.activeSequence.markers.getFirstMarker().guid` `app.project.rootItem.children[index].getMarkers().getFirstMarker().guid` #### Description The unique identifier of the marker, created at time of instantiation. #### Type String; read-only. --- ### Marker.name `app.project.activeSequence.markers.getFirstMarker().name` `app.project.rootItem.children[index].getMarkers().getFirstMarker().name` #### Description The name of the marker. #### Type String; read/write. --- ### Marker.start `app.project.activeSequence.markers.getFirstMarker().start` `app.project.rootItem.children[index].getMarkers().getFirstMarker().start` #### Description A [Time object](../other/time.md) containing the value of the beginning of the marker. #### Type [Time object](../other/time.md); read/write. --- ### Marker.type `app.project.activeSequence.markers.getFirstMarker().type` `app.project.rootItem.children[index].getMarkers().getFirstMarker().type` #### Description The type of marker, one of: - "Comment" - "Chapter" - "Segmentation" - "WebLink" !!! note Premiere Pro can import some marker types which cannot be created from within Premiere Pro. #### Type String; read-only. ``` -------------------------------- ### Set and Get Color Labels Source: https://context7.com/docsforadobe/premiere-scripting-guide/llms.txt Allows setting and retrieving color labels for project items. Color labels are represented by integers from 0 to 15. Use this for visual organization. ```javascript // Set and get color labels (0-15) item.setColorLabel(3); // Orange var colorIndex = item.getColorLabel(); ``` -------------------------------- ### Get ProjectItem Embedded LUT ID Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/item/projectitem.md Retrieves the LUT ID embedded within a project item. This example logs the LUT ID to the Events panel. ```javascript var lutID = app.project.rootItem.children[0].getEmbeddedLUTID() app.setSDKEventMessage("LutID " + " = " + lutID, 'info'); ``` -------------------------------- ### app.enableQE() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/application/application.md Enables Premiere Pro's QE DOM. ```APIDOC ## app.enableQE() ### Description Enables Premiere Pro's QE DOM. ### Parameters None. ### Returns Returns `true` if QE DOM was enabled. ``` -------------------------------- ### Access Motion Graphics Template (MOGRT) and Master Clip Components Source: https://context7.com/docsforadobe/premiere-scripting-guide/llms.txt Illustrates how to specifically access Motion Graphics Template components on a clip and retrieve their exposed properties. Also shows how to get video components from a master project item. ```javascript // Access Motion Graphics Template component var mgtComponent = clip.getMGTComponent(); if (mgtComponent) { var mgtProps = mgtComponent.properties; // Access MOGRT parameters exposed by creator } // Access master clip video components var projectItem = app.project.rootItem.children[0]; var masterComponents = projectItem.videoComponents(); ``` -------------------------------- ### app.getPProSystemPrefPath Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/application/application.md Returns the path to Premiere Pro's active configuration files, which are not user-specific. ```APIDOC ### app.getPProSystemPrefPath `app.getPProSystemPrefPath` #### Description Premiere Pro's active configuration files, not specific to a given user. #### Type String; read-only. #### Example Get a path to a currently active configuration folder ```js app.getPProSystemPrefPath; // /Library/Application Support/Adobe/Adobe Premiere Pro 2020/ ``` ``` -------------------------------- ### Get ProjectItem Original Color Space Properties Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/item/projectitem.md Retrieves the original color space properties of a project item. Refer to ProjectItem.getColorSpace() for an example of how to use the returned object. ```javascript app.project.rootItem.children[index].getOriginalColorSpace() ``` -------------------------------- ### Get Application Preference Path Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/application/application.md Returns the file path to the active 'Adobe Premiere Pro Prefs' file for the current user. This path is read-only. ```javascript app.getAppPrefPath; // /Users/USERNAME/Documents/Adobe/Premiere Pro/14.0/Profile-USERNAME/ ``` -------------------------------- ### Get ProjectItem Color Space Properties Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/item/projectitem.md Retrieves the color space properties of a project item, including its name, transfer characteristics, primaries, and matrix equation. This example logs the properties to the Events panel. ```javascript var colorSpace = app.project.rootItem.children[0].getColorSpace() app.setSDKEventMessage("Color Space " + " = " + colorSpace.name, 'info'); app.setSDKEventMessage("Transfer Characteristic " + " = " + colorSpace.transferCharacteristic, 'info'); app.setSDKEventMessage("Color Primaries " + " = " + colorSpace.primaries, 'info'); app.setSDKEventMessage("Matrix Equation " + " = " + colorSpace.matrixEquation, 'info'); ``` -------------------------------- ### Create and Open Premiere Pro Projects Source: https://context7.com/docsforadobe/premiere-scripting-guide/llms.txt Methods for creating new projects, opening existing ones with various dialog suppression options, importing FCP XML files, and retrieving project objects by their view ID. ```javascript // Create a new project var newProjectPath = '~/Desktop/MyNewProject.prproj'; if (app.newProject(newProjectPath)) { alert('Project created successfully'); } // Check if a file is a valid Premiere Pro project if (app.isDocument('~/Desktop/myProject.prproj')) { // Open the project with various options var opened = app.openDocument( '~/Desktop/myProject.prproj', true, // suppressConversionDialog true, // bypassLocateFileDialog false, // bypassWarningDialog false // doNotAddToMRUList ); if (opened) { alert('Project opened: ' + app.project.name); } } // Open FCP XML as a Premiere Pro project app.openFCPXML('~/Desktop/export.xml', '~/Desktop/imported.prproj'); // Get project from view ID var allViewIDs = app.getProjectViewIDs(); if (allViewIDs) { var project = app.getProjectFromViewID(allViewIDs[0]); if (project) { alert('Project name: ' + project.name); } } ``` -------------------------------- ### Modify TrackItem Timing and Speed Source: https://context7.com/docsforadobe/premiere-scripting-guide/llms.txt Demonstrates how to change a clip's start and end times on the timeline, adjust its source in/out points, move it by a time offset, and get its speed and reversal status. ```javascript // Modify clip timing var clip = clips[0]; clip.start.seconds = 2.0; // Move clip start clip.end.seconds = 7.0; // Move clip end clip.inPoint.seconds = 1.0; // Change source in point clip.outPoint.seconds = 6.0; // Change source out point // Move clip by time offset clip.move(5.0); // Shift clip 5 seconds later // Check and modify speed var speed = clip.getSpeed(); // 1.0 = normal speed var isReversed = clip.isSpeedReversed(); ``` -------------------------------- ### Create Bins and Smart Bins Source: https://context7.com/docsforadobe/premiere-scripting-guide/llms.txt Demonstrates creating new bins, sub-bins, and smart bins (search bins) within the project. Smart bins can be defined using search criteria like frame size. ```javascript // Create bins var newBin = app.project.rootItem.createBin('Footage'); var subBin = newBin.createBin('Raw Clips'); // Create a smart bin (search bin) var smartBin = app.project.rootItem.createSmartBin('4K Clips', 'framesize:3840'); ``` -------------------------------- ### Access Marker GUID Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/general/marker.md Retrieves the unique identifier (GUID) of a marker. This attribute is read-only. ```javascript app.project.activeSequence.markers.getFirstMarker().guid ``` ```javascript app.project.rootItem.children[index].getMarkers().getFirstMarker().guid ``` -------------------------------- ### Access Marker Start Time Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/general/marker.md Accesses the start time of a marker as a Time object. This attribute is read/write. ```javascript app.project.activeSequence.markers.getFirstMarker().start ``` ```javascript app.project.rootItem.children[index].getMarkers().getFirstMarker().start ``` -------------------------------- ### ProjectItem.createSmartBin() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/item/projectitem.md Creates a search bin based on a provided query string. This method is applicable only to bin project items. ```APIDOC ## POST /api/bins/smart ### Description Creates a search bin; only works for bin project items. ### Method POST ### Endpoint `/api/bins/smart` ### Parameters #### Request Body - **name** (String) - Required - A name of a new bin. - **queryString** (String) - Required - Query string for search. ### Response #### Success Response (200) - **projectItem** (object) - A projectItem representing the newly-created bin. #### Response Example ```json { "projectItem": { "id": "456", "name": "Smart Bin", "type": "smartBin" } } ``` ``` -------------------------------- ### Get Sequence Settings Source: https://context7.com/docsforadobe/premiere-scripting-guide/llms.txt Retrieves the current settings of a sequence, including video frame size and audio properties. Use the returned object to inspect or modify settings. ```javascript var settings = sequence.getSettings(); alert('Frame size: ' + settings.videoFrameWidth + 'x' + settings.videoFrameHeight); alert('Audio channels: ' + settings.audioChannelCount); alert('Sample rate: ' + settings.audioSampleRate); ``` -------------------------------- ### Get and Set Project Metadata Source: https://context7.com/docsforadobe/premiere-scripting-guide/llms.txt Enables getting and setting project-specific metadata for a project item. You can specify which columns to update, such as intrinsic name. ```javascript // Get project metadata var projectMeta = item.getProjectMetadata(); item.setProjectMetadata(newMetadata, ['Column.Intrinsic.Name']); ``` -------------------------------- ### Create Caption Track Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/sequence/sequence.md Creates a new caption track on the active sequence. Specify the project item for the caption source, the start time offset, and the desired caption format. ```javascript app.project.activeSequence.createCaptionTrack(projectItem, 0, Sequence.CAPTION_FORMAT_708); ``` -------------------------------- ### Get Project View IDs Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/application/application.md Retrieves an array of all open project view IDs. Use this to check if any views are open and to get an ID for further operations. ```javascript var allViewIDs = app.getProjectViewIDs(); if (allViewIDs){ var firstOne = allViewIDs[0]; } else { // No views open. } ``` -------------------------------- ### Project.newBarsAndTone() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/general/project.md Creates a new bars and tone sequence with specified video and audio parameters, including dimensions, time base, pixel aspect ratio, audio sample rate, and a custom name. ```APIDOC ## Project.newBarsAndTone() ### Description Creates a new [Sequence object](../sequence/sequence.md) with the given name, based on the specified preset (.sqpreset file). ### Method POST (or similar, depending on API design) ### Endpoint `/api/project/newBarsAndTone` ### Parameters #### Path Parameters - **width** (Integer) - Required - The width of the bars and tone sequence. - **height** (Integer) - Required - The height of the bars and tone sequence. - **timeBase** (Float) - Required - A timebase for a new project item. - **PARNum** (Integer) - Required - Pixel aspect ratio numerator. - **PARDen** (Integer) - Required - Pixel aspect ratio denominator. - **audioSampleRate** (Float) - Required - Audio sample rate. - **name** (String) - Required - Name for a new project item. ### Response #### Success Response (200) - **result** (ProjectItem object) - Returns a [ProjectItem object](../item/projectitem.md) for the new bars and tone, or `0` if unsuccessful. ``` -------------------------------- ### Iterate and Access TrackItem Properties Source: https://context7.com/docsforadobe/premiere-scripting-guide/llms.txt Use this to loop through clips on a video track and access their properties like name, media type, duration, and timing. Also shows how to get the source project item. ```javascript var sequence = app.project.activeSequence; var track = sequence.videoTracks[0]; var clips = track.clips; // Iterate through clips for (var i = 0; i < clips.numItems; i++) { var clip = clips[i]; // Access clip properties alert('Clip: ' + clip.name); alert('Media Type: ' + clip.mediaType); // "Video" or "Audio" alert('Duration: ' + clip.duration.seconds + ' seconds'); // Timeline position (relative to sequence start) alert('Start: ' + clip.start.seconds); alert('End: ' + clip.end.seconds); // Source in/out points (relative to source media) alert('In Point: ' + clip.inPoint.seconds); alert('Out Point: ' + clip.outPoint.seconds); // Get source project item var sourceItem = clip.projectItem; alert('Source: ' + sourceItem.name); } ``` -------------------------------- ### Get Marker Color by Index Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/general/marker.md Gets the marker color index. This functionality was added in Adobe Premiere Pro 13.x. Requires the index of the marker. ```javascript app.project.activeSequence.markers.getFirstMarker().getColorByIndex(index) ``` ```javascript app.project.rootItem.children[index].getMarkers().getFirstMarker().getColorByIndex(index) ``` -------------------------------- ### Create Smart Bin in ProjectItem Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/item/projectitem.md Creates a search bin based on a query string. This method can only be used on existing bin project items. ```javascript app.project.rootItem.children[index].createSmartBin(name, queryString) ``` -------------------------------- ### TrackItem.disabled Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/item/trackitem.md Gets or sets the disabled state of a TrackItem. ```APIDOC ## TrackItem.disabled ### Description Sets the disabled state of the TrackItem. Read/Write. ### Method `GET`/`SET` (Implicit) ### Endpoint `app.project.sequences[index].audioTracks[index].clips[index].disabled` `app.project.sequences[index].videoTracks[index].clips[index].disabled` ### Parameters None. ### Returns Returns the disabled state of the TrackItem. ``` -------------------------------- ### Encoder.startBatch() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/general/encoder.md Initiates the rendering process for the Adobe Media Encoder render queue. ```APIDOC ## Encoder.startBatch() ### Description Makes Adobe Media Encoder start rendering its render queue. ### Method POST ### Endpoint /encoder/startBatch ### Parameters None. ### Response #### Success Response (200) - **result** (Integer) - Returns `0` if successful. ``` -------------------------------- ### Iterate and Inspect Project Items Source: https://context7.com/docsforadobe/premiere-scripting-guide/llms.txt This script iterates through all items in the project's root bin, checks their types (BIN, CLIP), and retrieves media paths for clips. It also includes logic to check if a clip is offline and attempt to refresh its media. ```javascript var rootItem = app.project.rootItem; // Iterate through project items for (var i = 0; i < rootItem.children.numItems; i++) { var item = rootItem.children[i]; // Check item type if (item.type === 'BIN') { alert('Bin: ' + item.name); } else if (item.type === 'CLIP') { alert('Clip: ' + item.name); // Get media path var mediaPath = item.getMediaPath(); // Check if item is offline if (item.isOffline()) { item.refreshMedia(); // Try to relink } } } ``` -------------------------------- ### Sequence.getSettings() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/sequence/sequence.md Retrieves the settings of the current sequence. ```APIDOC ## Sequence.getSettings() ### Description Retrieves the settings of the current sequence. ### Method Not specified (assumed to be a method of Sequence object) ### Endpoint Not applicable (scripting method) ### Parameters None. ### Response #### Success Response Returns the sequence settings. ### Response Example `SequenceSettings { frameRate: 29.97, frameSize: [1920, 1080], ... }` ``` -------------------------------- ### Rename and Move Project Items Source: https://context7.com/docsforadobe/premiere-scripting-guide/llms.txt Shows how to rename an existing bin and move a project item to a different bin. Ensure the item and target bin exist before execution. ```javascript // Rename a bin newBin.renameBin('Imported Footage'); // Move item to different bin var item = app.project.rootItem.children[0]; item.moveBin(newBin); ``` -------------------------------- ### Get Last Marker on Sequence Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/collection/markercollection.md Retrieve the marker with the latest timestamp from a sequence. ```javascript app.project.sequences[index].markers.getLastMarker() ``` -------------------------------- ### ProjectItem.createBin() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/item/projectitem.md Creates an empty bin within the project. This method is only effective when called on a bin project item. ```APIDOC ## POST /api/bins ### Description Creates an empty bin within the project. Only works within bins. ### Method POST ### Endpoint `/api/bins` ### Parameters #### Request Body - **name** (String) - Required - A name of a new bin. ### Response #### Success Response (200) - **projectItem** (object) - A project item representing the new bin. #### Response Example ```json { "projectItem": { "id": "123", "name": "New Bin", "type": "bin" } } ``` ``` -------------------------------- ### Get First Marker on Sequence Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/collection/markercollection.md Retrieve the marker with the earliest timestamp from a sequence. ```javascript app.project.sequences[index].markers.getFirstMarker() ``` -------------------------------- ### Application Properties Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/application/application.md Access to application-level properties such as Source Monitor, user GUID, and version. ```APIDOC ## app.sourceMonitor ### Description Provides access to [SourceMonitor object](../general/sourcemonitor.md). ### Type [SourceMonitor object](../general/sourcemonitor.md). --- ## app.userGuid ### Description A unique identifier for the currently logged-in Creative Cloud user. ### Type String; read-only. --- ## app.version ### Description The version of Premiere Pro, providing the API. ### Type String; read-only. ### Example Get a version of a current application *(Adobe Premiere Pro version 14.3.1 (Build 45))* ```js app.version; // 14.3.1 ``` ``` -------------------------------- ### Create Bin Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/item/projectitem.md Creates a new bin (folder) within the current project item. Requires a name for the new bin. ```javascript app.project.rootItem.children[index].createBin(name) ``` -------------------------------- ### Project.getInsertionBin() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/general/project.md Returns a ProjectItem object referencing the bin into which import will occur. ```APIDOC ## GET /project/insertionBin ### Description Returns a ProjectItem object referencing the bin into which import will occur. ### Method GET ### Endpoint /project/insertionBin ### Parameters None. ### Response #### Success Response (200) - **binItem** (ProjectItem object) - Returns a ProjectItem object if successful, 0 if not. ``` -------------------------------- ### Get Premiere Pro Version Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/application/application.md Retrieves the current version of the Premiere Pro application. ```javascript app.version; ``` -------------------------------- ### Project.newSequence() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/general/project.md Creates a new sequence with a specified name, based on a provided sequence preset file. ```APIDOC ## Project.newSequence() ### Description Creates a new [Sequence object](../sequence/sequence.md) with the given name, based on the specified preset (.sqpreset file). ### Method POST (or similar, depending on API design) ### Endpoint `/api/project/newSequence` ### Parameters #### Path Parameters - **name** (String) - Required - Name for the new sequence. - **pathToSequencePreset** (String) - Required - Path to the sequence preset (.sqpreset) file. ### Response #### Success Response (200) - **result** (Sequence object) - Returns the newly created [Sequence object](../sequence/sequence.md). ``` -------------------------------- ### Clear In Point Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/item/projectitem.md Removes any assigned in point for a project item, causing it to start at its default startTime. ```javascript app.project.rootItem.children[index].clearInPoint() ``` -------------------------------- ### app.newProject() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/application/application.md Creates a new .prproj Project object, at the specified path. ```APIDOC ## app.newProject(path) ### Description Creates a new .prproj [Project object](../general/project.md), at the specified path. ### Parameters #### Path Parameters - **path** (String) - Required - A full path to new project; a .prproj extension will *not* be added. ### Returns Returns `true` if successful. ``` -------------------------------- ### Get Last Marker on Project Item Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/collection/markercollection.md Retrieve the marker with the latest timestamp from a project item. ```javascript app.project.rootItem.children[index].getMarkers().getLastMarker() ``` -------------------------------- ### Get First Marker on Project Item Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/collection/markercollection.md Retrieve the marker with the earliest timestamp from a project item. ```javascript app.project.rootItem.children[index].getMarkers().getFirstMarker() ``` -------------------------------- ### Create New Sequence from Preset Source: https://context7.com/docsforadobe/premiere-scripting-guide/llms.txt Creates a new sequence using a specified preset file. Ensure the preset path is correct. ```javascript var project = app.project; var newSeq = project.newSequence('My Sequence', '~/Presets/1080p30.sqpreset'); ``` -------------------------------- ### Get Number of Markers Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/collection/markercollection.md Retrieve the total count of markers present in a sequence or project item. ```javascript app.project.sequences[index].markers.numMarkers ``` ```javascript app.project.rootItem.children[index].getMarkers().numMarkers ``` -------------------------------- ### Project Settings Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/general/project.md This section describes the parameters used for setting project properties and the return value indicating success or failure. ```APIDOC ## Project Settings ### Description This endpoint allows for the configuration of project settings, including specifying a new path and selecting a scratch disk type. ### Method POST ### Endpoint /project/settings ### Parameters #### Query Parameters - **newPath** (String) - Required - A new path for the project. - **scratchDiskType** (ScratchDiskType enum) - Required - Specifies the type of scratch disk to use. Possible values include: - ScratchDiskType.FirstVideoCaptureFolder - ScratchDiskType.FirstAudioCaptureFolder - ScratchDiskType.FirstVideoPreviewFolder - ScratchDiskType.FirstAudioPreviewFolder - ScratchDiskType.FirstAutoSaveFolder - ScratchDiskType.FirstCCLibrariesFolder - ScratchDiskType.FirstCapsuleMediaFolder ### Response #### Success Response (200) - **status** (String) - Indicates the success of the operation. #### Error Response (400) - **error** (String) - Description of the error. ### Returns Returns `0` if unsuccessful. ``` -------------------------------- ### Access ProjectItemCollection Children Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/collection/projectitemcollection.md Access the children of the root item in the active project to get the ProjectItemCollection. ```javascript app.project.rootItem.children ``` -------------------------------- ### ProjectItem.select() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/item/projectitem.md Sets the project item as the target for subsequent imports into the project. The project item must be a bin. ```APIDOC ## ProjectItem.select() ### Description Sets the project item (which must be a bin), as the target for subsequent imports into the project. ### Method POST (implied) ### Endpoint `app.project.rootItem.children[index].select()` ### Parameters None. ### Returns Returns `0` if the project item has successfully been made the target, for subsequent imports. ``` -------------------------------- ### Manage Project Item Markers Source: https://context7.com/docsforadobe/premiere-scripting-guide/llms.txt Shows how to create and set markers on individual project items, distinct from sequence markers. Useful for annotating source media. ```javascript // Work with project item markers var projectItem = app.project.rootItem.children[0]; var itemMarkers = projectItem.getMarkers(); var clipMarker = itemMarkers.createMarker(2.5); clipMarker.name = 'Important moment'; clipMarker.setTypeAsComment(); ``` -------------------------------- ### Get ProjectItem Input LUT ID Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/item/projectitem.md Retrieves the input LUT ID associated with a project item. ```javascript app.project.rootItem.children[index].getInputLUTID() ``` -------------------------------- ### Find Project Items by Media Path Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/item/projectitem.md Locates and returns an array of project items that share the same media path. Optionally exclude sub-clips from the results. ```javascript app.project.rootItem.children[index].findItemsMatchingMediaPath(pathToMatch, ignoreSubClips) ``` -------------------------------- ### Get Number of Items in ComponentCollection Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/collection/componentcollection.md Retrieve the total number of components within a ComponentCollection. This attribute is read-only. ```javascript app.project.rootItem.children[index].videoComponents().numItems ``` ```javascript app.project.sequences[index].audioTracks[index].clips[index].components.numItems ``` ```javascript app.project.sequences[index].videoTracks[index].clips[index].components.numItems ``` -------------------------------- ### ProjectItem.findItemsMatchingMediaPath() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/item/projectitem.md Retrieves an array of project items that reference the same media path. ```APIDOC ## GET /api/media/items ### Description Returns an array of project items, all of which reference the same media path. ### Method GET ### Endpoint `/api/media/items` ### Parameters #### Query Parameters - **pathToMatch** (String) - Required - A path to match. - **ignoreSubClips** (Integer) - Optional - If 1, no subclips will be returned. ### Response #### Success Response (200) - **projectItems** (array) - An array of project items matching the criteria. #### Response Example ```json { "projectItems": [ { "id": "101", "name": "Footage A", "mediaPath": "/path/to/media/a.mp4" }, { "id": "102", "name": "Footage A - Clip 1", "mediaPath": "/path/to/media/a.mp4" } ] } ``` ``` -------------------------------- ### ProjectItem.getInPoint() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/item/projectitem.md Obtains the current project item in point. This is useful for determining the start time of a clip within the project. ```APIDOC ## GET /projectItem/getInPoint ### Description Obtains the current project item in point. ### Method GET ### Endpoint `app.project.rootItem.children[index].getInPoint()` ### Parameters None. ### Returns A [Time object](../other/time.md), containing the in point. ``` -------------------------------- ### Encoder.launchEncoder() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/general/encoder.md Launches the Adobe Media Encoder application. ```APIDOC ## POST /app/encoder/launchencoder ### Description Launches Adobe Media Encoder. ### Method POST ### Endpoint /app/encoder/launchencoder ### Parameters None. ### Response #### Success Response (200) - **status** (Integer) - Returns `0` if successful. ### Request Example ```json {} ``` ### Response Example ```json { "status": 0 } ``` ``` -------------------------------- ### Set Sequence Zero Point Source: https://context7.com/docsforadobe/premiere-scripting-guide/llms.txt Sets the starting timecode of the sequence. The value is a string representing time in ticks. ```javascript sequence.setZeroPoint('9160560000000'); // 01:00:00:00 at 24fps ``` -------------------------------- ### Import Motion Graphics Template (MOGRT) Source: https://context7.com/docsforadobe/premiere-scripting-guide/llms.txt Imports a Motion Graphics Template (MOGRT) into the sequence at a specified time and track offsets. Requires the path to the MOGRT file. ```javascript var mgtTrackItem = sequence.importMGT( '~/Templates/LowerThird.mogrt', '0', // time in ticks 0, // vidTrackOffset 0 // audTrackOffset ); ``` -------------------------------- ### Get ProjectItem Color Label Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/item/projectitem.md Retrieves the integer value representing the color label assigned to a project item. ```javascript app.project.rootItem.children[index].getColorLabel() ``` -------------------------------- ### Sequence.importMGTFromLibrary() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/sequence/sequence.md Imports a MOGRT, or an After Effects Motion Graphics Template, from the current Premiere Pro user's Creative Cloud Libraries, to the specified video or audio track, at the specified time. ```APIDOC ## Sequence.importMGTFromLibrary() ### Description Imports a MOGRT, or an After Effects Motion Graphics Template, from the current Premiere Pro user's Creative Cloud Libraries, to the specified video or audio track, at the specified time. ### Method POST ### Endpoint app.project.sequences[index].importMGTFromLibrary(libraryName, mgtName, time, vidTrackOffset, audTrackOffset) ### Parameters #### Path Parameters None. #### Query Parameters None. #### Request Body - **libraryName** (String) - Required - The name of the Creative Cloud Library. - **mgtName** (String) - Required - The name of the MOGRT within the library. - **time** (String) - Required - The time at which to insert .mogrt, in ticks. - **vidTrackOffset** (Integer) - Required - How many tracks from the zero-th video track, into which to insert .mogrt content. - **audTrackOffset** (Integer) - Required - How many tracks from the zero-th audio track, into which to insert .mogrt content. ### Response #### Success Response (200) - **Return Value** (TrackItem object) - The imported MOGRT as a TrackItem object. ``` -------------------------------- ### Project.saveAs Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/general/project.md Exports the current project to a new file path, then opens the project from the new location. ```APIDOC ## POST /api/project/saveAs ### Description Exports the current project to a new unique file path, opens the project from the new location, and closes the previously-opened (and identical) project. ### Method POST ### Endpoint /api/project/saveAs ### Parameters #### Query Parameters - **path** (String) - Required - A path to a new file. ### Response #### Success Response (200) - **result** (Integer) - Returns 0 if successful, or an error code if not. ### Response Example ```json { "result": 0 } ``` ``` -------------------------------- ### Get Previous Marker on Sequence Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/collection/markercollection.md Find the marker that occurs immediately before a given marker in a sequence, sorted by time. ```javascript app.project.sequences[index].markers.getPrevMarker(currentMarker) ``` -------------------------------- ### Get Next Marker on Sequence Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/collection/markercollection.md Find the marker that occurs immediately after a given marker in a sequence, sorted by time. ```javascript app.project.sequences[index].markers.getNextMarker(currentMarker) ``` -------------------------------- ### app.getAppSystemPrefPath Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/application/application.md Returns the path to Premiere Pro's active configuration files, which are not user-specific. ```APIDOC ### app.getAppSystemPrefPath `app.getAppSystemPrefPath` #### Description Premiere Pro's active configuration files, not specific to a given user. #### Type String; read-only. #### Example Get a path to a currently active configuration folder ```js app.getAppSystemPrefPath; // /Library/Application Support/Adobe/Adobe Premiere Pro 2020/ ``` ``` -------------------------------- ### Access Marker Collection on Project Item Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/collection/markercollection.md Access the MarkerCollection for a project item by getting its children and then calling getMarkers(). ```javascript app.project.rootItem.children[index].getMarkers() ``` -------------------------------- ### SourceMonitor.openProjectItem() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/general/sourcemonitor.md Opens a specified project item in the Source monitor. ```APIDOC ## SourceMonitor.openProjectItem(projectItem) `app.sourceMonitor.openProjectItem(projectItem)` ### Description Open a project item in the Source monitor. ### Method JavaScript ### Endpoint app.sourceMonitor.openProjectItem(projectItem) ### Parameters #### Path Parameters None. #### Query Parameters None. #### Request Body None. ### Parameters - **projectItem** (ProjectItem object) - Required - A project item to open. ([ProjectItem object](../item/projectitem.md)) ### Request Example ```javascript // Assuming 'myProjectItem' is a valid ProjectItem object app.sourceMonitor.openProjectItem(myProjectItem); ``` ### Returns - **integer** - Returns `0` if successful. ``` -------------------------------- ### Get Project Item In Point Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/item/projectitem.md Obtains the current in point of a project item. Returns a Time object representing the in point. ```javascript app.project.rootItem.children[index].getInPoint() ``` -------------------------------- ### Get Project Path Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/general/project.md Retrieves the file path of the currently active project. Ensure a project is open before accessing this property. ```javascript app.project.path; // /Users/USERNAME/Desktop/Project.prproj ``` -------------------------------- ### Sequence.importMGT() Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/sequence/sequence.md Imports a MOGRT, or an After Effects Motion Graphics Template, to the specified video or audio track, at the specified time. ```APIDOC ## Sequence.importMGT() ### Description Imports a MOGRT, or an After Effects Motion Graphics Template, to the specified video or audio track, at the specified time. ### Method POST ### Endpoint app.project.sequences[index].importMGT(path, time, vidTrackOffset, audTrackOffset) ### Parameters #### Path Parameters None. #### Query Parameters None. #### Request Body - **path** (String) - Required - Full path to a valid MOGRT (.mogrt file), created in After Effects. - **time** (String) - Required - The time at which to insert .mogrt, in ticks. - **vidTrackOffset** (Integer) - Required - How many tracks from the zero-th video track, into which to insert .mogrt content. - **audTrackOffset** (Integer) - Required - How many tracks from the zero-th audio track, into which to insert .mogrt content. ### Response #### Success Response (200) - **Return Value** (TrackItem object) - The imported MOGRT as a TrackItem object. ``` -------------------------------- ### Get Web Link URL Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/general/marker.md Retrieves the URL from a marker's URL field. Returns a string or '0' if unsuccessful. ```javascript app.project.activeSequence.markers.getFirstMarker().getWebLinkURL() ``` ```javascript app.project.rootItem.children[index].getMarkers().getFirstMarker().getWebLinkURL() ``` -------------------------------- ### Project.openSequence Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/general/project.md Activates a sequence by its ID, opening it in the Timeline panel. ```APIDOC ## POST /api/project/openSequence ### Description Makes the Sequence object with the provided sequence ID, active. This will open the sequence in the Timeline panel. ### Method POST ### Endpoint /api/project/openSequence ### Parameters #### Query Parameters - **sequenceID** (Sequence.sequenceID) - Required - A valid sequence ID that should be opened. ### Response #### Success Response (200) - **success** (boolean) - Returns true if successful, false if not. ### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Get First Marker from Sequence Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/general/marker.md Retrieves the first marker associated with the active sequence. Ensure a sequence is active before calling. ```javascript app.project.activeSequence.markers.getFirstMarker() ``` -------------------------------- ### ProjectItem Methods Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/item/projectitem.md Details on the methods available for the ProjectItem object, including attaching proxies, changing media paths, and managing in/out points. ```APIDOC ## ProjectItem Methods ### ProjectItem.attachProxy() `app.project.rootItem.children[index].attachProxy(mediaPath, isHiRes)` #### Description Attaches the media at `newMediaPath` to the project item, as either hi-res or proxy media. #### Parameters | Parameter | Type | Description | | ----------- | ------- | ---------------------------------------------------------------------------------------- | | `mediaPath` | String | The path to the the newly-assigned media. | | `isHiRes` | Integer | Whether the new media should be attached as the proxy `0`, or high resolution `1` media. | #### Returns Returns `0` if successful. --- ### ProjectItem.canChangeMediaPath() `app.project.rootItem.children[index].canChangeMediaPath()` #### Description Returns `true` if Premiere Pro can change the path, associated with this project item; otherwise, returns `false`. #### Parameters None. #### Returns Boolean; `true` if media can be replaced, `false` if not. --- ### ProjectItem.canProxy() `app.project.rootItem.children[index].canProxy()` #### Description Indicates whether it's possible to attach a proxy, to this project item. #### Parameters None. #### Returns Returns `true` if the project item permits a proxy to be attached; `false` if not. --- ### ProjectItem.changeMediaPath() `app.project.rootItem.children[index].changeMediaPath(newPath)` #### Description Updates the project item to point to a new media path. #### Parameters | Parameter | Type | Description | | ---------------- | ------- | ----------------------------- | | `newPath` | String | A new path to the media file. | | `overrideChecks` | Boolean | Override any safety concerns. | #### Returns Returns `0` if replacement was successful. --- ### ProjectItem.clearInPoint() `app.project.rootItem.children[index].clearInPoint()` #### Description Clears any assigned in point; the project item will then start at `startTime`. #### Parameters None #### Returns Returns `0` if successful. --- ### ProjectItem.clearOutPoint() `app.project.rootItem.children[index].clearOutPoint()` #### Description Clears any assigned out point; the project item will then start at `startTime`. #### Parameters None #### Returns Returns `0` if successful. --- ### ProjectItem.createBin() `app.project.rootItem.children[index].createBin(name)` #### Description Creates a new bin within the current project item. #### Parameters | Parameter | Type | Description | | --------- | ------ | ---------------- | | `name` | String | The name of the bin. | #### Returns Returns the newly created Bin object if successful. ``` -------------------------------- ### Get Number of Video Tracks Source: https://github.com/docsforadobe/premiere-scripting-guide/blob/master/docs/collection/trackcollection.md Retrieve the total count of video tracks present in a sequence. This is a read-only integer attribute. ```javascript app.project.sequences[index].videoTracks.numTracks ```