├── .gitignore ├── figure-dark.png ├── figure-light.png ├── typings ├── readme.md ├── XMPScript.d.ts ├── PlugPlugExternalObject.d.ts ├── global.d.ts └── PremierePro.23.0.d.ts ├── premiereremote-logo.png ├── host ├── tsconfig.json ├── types.d.ts ├── package.json ├── esbuild.js ├── src │ └── index.tsx └── package-lock.json ├── client ├── main.css ├── package.json ├── index.html ├── index.js └── CSInterface.js ├── sample.ahk ├── .debug ├── LICENSE ├── CSXS └── manifest.xml └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .idea/ 3 | jquery.min.js 4 | host/build/ 5 | plugin/ -------------------------------------------------------------------------------- /figure-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sebinside/PremiereRemote/HEAD/figure-dark.png -------------------------------------------------------------------------------- /figure-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sebinside/PremiereRemote/HEAD/figure-light.png -------------------------------------------------------------------------------- /typings/readme.md: -------------------------------------------------------------------------------- 1 | These typings are from: https://github.com/Adobe-CEP/Samples/tree/master/PProPanel/jsx -------------------------------------------------------------------------------- /premiereremote-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sebinside/PremiereRemote/HEAD/premiereremote-logo.png -------------------------------------------------------------------------------- /host/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "ES6", 4 | "target": "ES5", 5 | "noLib": true, 6 | "jsx": "preserve", 7 | "outDir": "build", 8 | "rootDir": "src", 9 | "skipLibCheck": true 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /host/types.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// -------------------------------------------------------------------------------- /host/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "host", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.jsx", 6 | "scripts": { 7 | "build": "tsc && node esbuild.js" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "devDependencies": { 13 | "esbuild": "^0.14.36", 14 | "typescript": "^5.3.3" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /client/main.css: -------------------------------------------------------------------------------- 1 | * { 2 | font-family: sans-serif; 3 | background: #232323; 4 | overflow-y: hidden; 5 | color: #BBBBBB; 6 | font-size: 11pt; 7 | } 8 | 9 | #statusContainer { 10 | font-weight: bold; 11 | } 12 | 13 | .red { 14 | color: red; 15 | } 16 | 17 | .green { 18 | color:green; 19 | } 20 | 21 | #lastCommandContainer { 22 | font-size:8pt; 23 | } -------------------------------------------------------------------------------- /client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "premiereremote", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "dependencies": { 7 | "express": "^4.21.2", 8 | "swagger-jsdoc": "^3.2.9", 9 | "swagger-ui-express": "^4.6.0", 10 | "ws": "^8.18.0" 11 | }, 12 | "scripts": { 13 | "test": "echo \"Error: no test specified\" && exit 1" 14 | }, 15 | "author": "", 16 | "license": "ISC" 17 | } 18 | -------------------------------------------------------------------------------- /sample.ahk: -------------------------------------------------------------------------------- 1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 2 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 3 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 4 | 5 | 6 | ; Interesting code starts here, lol 7 | F10:: 8 | Run curl ""http://localhost:8081/alert?content=helloworld"",,hide 9 | return 10 | 11 | F11:: 12 | Run curl ""http://localhost:8081/projectNameAlert"",,hide 13 | return -------------------------------------------------------------------------------- /host/esbuild.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | require('esbuild').build({ 3 | entryPoints: ['build/index.jsx'], 4 | bundle: true, 5 | charset: "utf8", 6 | target: 'es5', 7 | format: 'iife', 8 | outfile: 'build/out/index.jsx', 9 | }) 10 | .catch(() => process.exit(1)) 11 | .then(() => { 12 | console.log("Build successful. Modifying index.jsx now."); 13 | const lines = fs.readFileSync('./build/out/index.jsx', 'utf8').split('\n'); 14 | lines.shift(); // Remove first line 15 | lines.pop(); // Remove last line 16 | lines.pop(); // Remove second last line 17 | fs.writeFileSync('./build/out/index.jsx', lines.join('\n')); 18 | }) 19 | -------------------------------------------------------------------------------- /.debug: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PremiereRemote 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 19 | 20 | 21 |
Loading...
22 |
Last Command...
23 | 26 | 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 sebinside 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /host/src/index.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * ALL functions defined here are visible via the localhost service. 3 | */ 4 | export const host = { 5 | /** 6 | * @swagger 7 | * 8 | * /kill: 9 | * get: 10 | * description: This method is only there for debugging purposes. 11 | * For more information, please have a look at the index.js file. 12 | */ 13 | kill: function () { }, 14 | 15 | /** 16 | * @swagger 17 | * /yourNewFunction?param1={param1}¶m2={param2}: 18 | * get: 19 | * description: Your new function, ready to be called! 20 | * parameters: 21 | * - name: param1 22 | * description: Just a sample parameter 23 | * in: path 24 | * type: string 25 | * - name: param2 26 | * description: Just another sample parameter 27 | * in: path 28 | * type: string 29 | */ 30 | yourNewFunction: function (param1, param2) { 31 | alert(param1 + " " + param2); 32 | } 33 | }; 34 | 35 | /** 36 | * These functions are only used internally. 37 | */ 38 | export const framework = { 39 | enableQualityEngineering: function () { 40 | app.enableQE(); 41 | } 42 | }; 43 | -------------------------------------------------------------------------------- /CSXS/manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ./client/index.html 22 | ./host/build/out/index.jsx 23 | 24 | --enable-nodejs 25 | 26 | 27 | 28 | true 29 | 30 | 31 | Panel 32 | PremiereRemote 33 | 34 | 35 | 50 36 | 200 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /typings/XMPScript.d.ts: -------------------------------------------------------------------------------- 1 | // A commonly used construct for loading XMPScript into 2 | // ExtendScript contexts. 3 | interface ExternalObjectConstructor { 4 | AdobeXMPScript: ExternalObject | undefined; 5 | } 6 | 7 | interface XMPMetaConstructor { 8 | /** Creates an empty object. */ 9 | new (): XMPMetaInstance; 10 | /** 11 | * @param packet A String containing an XML file or an XMP packet. 12 | */ 13 | new (packet: string): XMPMetaInstance; 14 | /** 15 | * @param buffer The UTF-8 or UTF-16 encoded bytes of an XML file 16 | * or an XMP packet. This array is the result of a call to `serializeToArray` 17 | * on an `XMPMeta` instance. 18 | */ 19 | new (buffer: number[]): XMPMetaInstance; 20 | 21 | // Class stuff. 22 | } 23 | 24 | interface XMPMetaInstance { 25 | doesPropertyExist(namespace:String, value:String): Boolean 26 | getProperty(namespace:String, property:String): XMPProperty 27 | setProperty(namespace:String, property:String, value:String): Boolean 28 | countArrayItems(namespace:String, property:String): Number 29 | getArrayItem(namespace:String, property:String, itemIndex:Number): XMPProperty 30 | deleteProperty(namespace:String, property:String): Boolean 31 | appendArrayItem(namespace:String, property:String, arrayOptions:String, valueToAppend:String, valueOptions:String): Boolean 32 | dumpObject():String 33 | serialize(): String 34 | // Instance stuff. 35 | } 36 | 37 | declare const XMPMeta: XMPMetaConstructor | undefined; 38 | 39 | interface XMPConstConstructor { 40 | new (): XMPConstInstance; 41 | NS_DM: string; 42 | NS_DC: string; 43 | ARRAY_IS_ORDERED: string; 44 | // Class stuff. 45 | } 46 | 47 | interface XMPConstInstance { 48 | // Instance stuff. 49 | } 50 | 51 | declare const XMPConst: XMPConstConstructor | undefined; 52 | -------------------------------------------------------------------------------- /typings/PlugPlugExternalObject.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | interface ExternalObjectConstructor { 4 | readonly prototype: ExternalObject 5 | 6 | /** 7 | * Creates a new ExternalObject object. 8 | */ 9 | new (lib: string): ExternalObject 10 | (lib: string): ExternalObject 11 | } 12 | declare const ExternalObject: ExternalObjectConstructor 13 | 14 | interface ExternalObject { 15 | /** 16 | * Set to true to write status information to standard output (the 17 | * JavaScript Console in the ExtendScript Toolkit). Set to false to turn 18 | * logging off. Default is false. 19 | */ 20 | log: boolean 21 | 22 | /** 23 | * A set of alternate paths in which to search for the shared library files, a 24 | * single string with multiple path specifications delimited by semicolons 25 | * (;). Paths can be absolute or relative to the Folder.startup location. 26 | */ 27 | searchFolders: string 28 | 29 | /** 30 | * The version of the library, as returned by ESGetVersion() 31 | */ 32 | version: number 33 | 34 | /** 35 | * Reports whether a compiled C/C++ library can be found, but does not load it. If logging is on, the 36 | * paths searched are reported to the JavaScript Console in the ExtendScript Toolkit. 37 | * Returns true if the library is found, false otherwise. 38 | * @param spec The file specification for the compiled library, with or without path information. 39 | */ 40 | search(spec: string): boolean 41 | 42 | /** 43 | * Explicitly shuts down the ExternalObject dynamic library wrapped by this instance. 44 | * It can be helpful to force a shutdown of the external library if termination of external libraries during 45 | * the shutdown of the hosting application does not occur in the correct order. 46 | */ 47 | terminate(): undefined 48 | } 49 | 50 | class CSXSEvent { 51 | /** 52 | * Retrieves the unique identifier of the application from which this event was dispatched. 53 | */ 54 | readonly appId: string 55 | 56 | /** 57 | * Retrieves or sets the payload of this event. 58 | */ 59 | data: string 60 | 61 | /** 62 | * Retrieves the unique identifier of the extension from which this event was dispatched. 63 | */ 64 | readonly extensionId: string 65 | 66 | /** 67 | * Retrieves the scope of this event. 68 | */ 69 | scope: string 70 | 71 | /** 72 | * Retrieves the type of this event. 73 | */ 74 | type: string 75 | 76 | /** 77 | * Dispatch the event 78 | */ 79 | dispatch(): void 80 | } 81 | -------------------------------------------------------------------------------- /client/index.js: -------------------------------------------------------------------------------- 1 | // Loading CS Interface and express via npm 2 | const csInterface = new CSInterface(); 3 | const loc = window.location.pathname; 4 | const dir = decodeURI(loc.substring(1, loc.lastIndexOf('/'))); 5 | 6 | // Dependencies 7 | const express = require(dir + "/node_modules/express/index.js"); 8 | const swaggerJsDoc = require(dir + "/node_modules/swagger-jsdoc/index.js"); 9 | const swaggerUi = require(dir + "/node_modules/swagger-ui-express/index.js"); 10 | const websocket = require(dir + "/node_modules/ws/index.js"); 11 | 12 | function init() { 13 | console.log("Starting PremiereRemote initialization..."); 14 | 15 | // Setup server 16 | console.log("Starting PremiereRemote server setup..."); 17 | const app = express(); 18 | const router = express.Router(); 19 | console.log("Finished PremiereRemote server setup."); 20 | 21 | // Setup swagger endpoint 22 | console.log("Starting Swagger setup..."); 23 | setupSwagger(app); 24 | console.log("Finished Swagger setup."); 25 | 26 | // Setup endpoints 27 | console.log("Starting API endpoint setup..."); 28 | for (const functionDeclaration in host) { 29 | const key = functionDeclaration; 30 | const signature = host[key].toString().split("{")[0]; 31 | console.log(`Setting up endpoint: "${key}".`); 32 | 33 | if (signature === host[key].toString()) { 34 | console.error("Unable to read function definition of '" + key + "'."); 35 | } else { 36 | 37 | const parameters = extractParameters(signature); 38 | 39 | router.get('/' + key, function (req, res) { 40 | 41 | // Special code for faster debugging 42 | if (key === "kill") { 43 | res.json({ message: 'ok.' }); 44 | csInterface.closeExtension(); 45 | } 46 | 47 | // Count request query parameters 48 | let propertyCount = 0; 49 | for (const propName in req.query) { 50 | if (req.query.hasOwnProperty(propName)) { 51 | propertyCount++; 52 | } 53 | } 54 | 55 | // Extract request query parameters 56 | let params = []; 57 | for (const id in parameters) { 58 | const propName = parameters[id]; 59 | if (req.query.hasOwnProperty(propName)) { 60 | params.push(req.query[propName]); 61 | } else { 62 | console.error("Param not found: '" + propName + "'"); 63 | } 64 | } 65 | 66 | // Check query parameter count 67 | if (parameters.length === params.length && params.length === propertyCount) { 68 | executeCommand(key, params, res); 69 | } else { 70 | res.json({ message: 'error. wrong parameters.' }); 71 | } 72 | 73 | }); 74 | } 75 | } 76 | console.log("Finished API endpoint setup.") 77 | 78 | console.log("Starting WebSocket server setup..."); 79 | setupWebSocketServer(); 80 | console.log("Finished WebSocket server setup."); 81 | 82 | // Start server 83 | console.log(`Starting the PremiereRemote server now on port ${SERVER_PORT}.`); 84 | app.use('/', router); 85 | app.listen(SERVER_PORT); 86 | 87 | // Enable QE 88 | if (ENABLE_QE) { 89 | console.log("Enabling the undocumented QE API. Be careful!") 90 | csInterface.evalScript("framework.enableQualityEngineering();") 91 | } 92 | 93 | document.getElementById("statusContainer").innerHTML = "Ready!"; 94 | document.getElementById("statusContainer").className = "green"; 95 | 96 | console.log("Finished PremiereRemote initialization.") 97 | } 98 | 99 | function setupWebSocketServer() { 100 | console.log(`Starting the PremiereRemote websocket server now on port ${WS_SERVER_PORT}.`); 101 | const wss = new websocket.WebSocketServer({ port: WS_SERVER_PORT }); 102 | 103 | wss.on('connection', function connection(ws) { 104 | ws.on('error', console.error); 105 | 106 | ws.on('message', function message(data) { 107 | const parts = String(data).split(","); 108 | if(parts.length < 1) { 109 | console.error("Invalid websocket message format. Expected: '' or ','"); 110 | } else { 111 | const command = parts[0]; 112 | const values = parts.slice(1).join(","); 113 | document.getElementById("lastCommandContainer").innerHTML = 114 | `ws: ${command}`; 115 | csInterface.evalScript(`host.${command}(${values});`); 116 | } 117 | }); 118 | }); 119 | } 120 | 121 | function setupSwagger(swaggerApp) { 122 | const options = { 123 | swaggerDefinition: { 124 | info: { 125 | title: 'PremiereRemote', 126 | version: PREMIERE_REMOTE_VERSION, 127 | description: 'Customizable remote access to Adobe Premiere Pro CEP.', 128 | }, 129 | }, 130 | // List of files to be processed 131 | apis: [dir + '/../host/build/index.jsx'], 132 | }; 133 | 134 | const specs = swaggerJsDoc(options); 135 | swaggerApp.use('/api-docs', swaggerUi.serve, swaggerUi.setup(specs)); 136 | } 137 | 138 | const STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; 139 | const ARGUMENT_NAMES = /([^\s,]+)/g; 140 | 141 | function extractParameters(signature) { 142 | const fnStr = signature.toString().replace(STRIP_COMMENTS, ''); 143 | let result = fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')).match(ARGUMENT_NAMES); 144 | if (result === null) 145 | result = []; 146 | return Array.prototype.slice.call(result); 147 | } 148 | 149 | function executeCommand(command, params, res) { 150 | console.log(`Retrieved endpoint call: "${command}"`); 151 | document.getElementById("lastCommandContainer").innerHTML = command; 152 | 153 | command += "("; 154 | for (let i = 0; i < params.length; i++) { 155 | command += '"' + params[i] + '"'; 156 | 157 | if (i < (params.length - 1)) { 158 | command += ", "; 159 | } 160 | } 161 | command += ");"; 162 | 163 | console.log(`Execute command: "${command}"`); 164 | csInterface.evalScript("host." + command, function (functionResult) { 165 | if(res) { 166 | res.json({ message: 'ok.', result: functionResult }); 167 | } 168 | }); 169 | } 170 | 171 | function openHostWindow() { 172 | console.log(`Opening explorer window for host folder inside "${dir}".`); 173 | require('child_process').exec('start "" "' + dir + '/../host"'); 174 | } 175 | -------------------------------------------------------------------------------- /typings/global.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * The global BridgeTalk object. 3 | */ 4 | declare var BridgeTalk: any 5 | 6 | /** 7 | * The Infinity global property is a predefined variable with the value for infinity. 8 | */ 9 | declare var Infinity: number 10 | 11 | /** 12 | * The NaN global property is a predefined variable with the value NaN (Not-a-Number), as specified by the IEEE-754 standard. 13 | */ 14 | declare var NaN: number 15 | 16 | /** 17 | * The application object 18 | */ 19 | declare var app: Application 20 | declare interface Application {} 21 | 22 | /** 23 | * Displays an alert box 24 | * @param message The text to display 25 | * @param title The title of the alert; ignored on the Macintosh 26 | * @param errorIcon Display an Error icon; ignored on the Macintosh 27 | */ 28 | declare function alert(message: string, title?: string, errorIcon?: boolean): void 29 | 30 | /** 31 | * Displays an alert box with Yes and No buttons; returns true for Yes 32 | * @param message The text to display 33 | * @param noAsDefault Set to true to set the No button as the default button 34 | * @param title The title of the alert; ignored on the Macintosh 35 | */ 36 | declare function confirm(message: string, noAsDefault?: boolean, title?: string): boolean 37 | 38 | /** 39 | * Decodes a string created with encodeURI(). 40 | * @param uri The text to decode. 41 | */ 42 | declare function decodeURI(uri: string): string 43 | 44 | /** 45 | * Decodes a string created with encodeURIComponent(). 46 | * @param uri The text to decode. 47 | */ 48 | declare function decodeURIComponent(uri: string): string 49 | 50 | /** 51 | * Encodes a string after RFC2396. 52 | * Create an UTF-8 ASCII encoded version of this string. The string is converted into UTF-8. Every non-alphanumeric character is encoded as a percent escape 53 | * character of the form %xx, where xx is the hex value of the character. After the conversion to UTF-8 encoding and escaping, it is guaranteed that the string does not contain characters codes greater than 127. The list of characters not to be encoded is -_.!~*'();/?:@&=+$,#. The method returns false on errors. 54 | * @param text The text to encode. 55 | */ 56 | declare function encodeURI(text: string): string 57 | 58 | /** 59 | * Encodes a string after RFC2396. 60 | * Create an UTF-8 ASCII encoded version of this string. The string is converted into UTF-8. Every non-alphanumeric character is encoded as a percent escape 61 | * character of the form %xx, where xx is the hex value of the character. After the conversion to UTF-8 encoding and escaping, it is guaranteed that the string does not contain characters codes greater than 127. The list of characters not to be encoded is -_.!~*'(). The method returns false on errors. 62 | * @param text The text to encode. 63 | */ 64 | declare function encodeURIComponent(text: string): string 65 | 66 | /** 67 | * Creates a URL-encoded string from aString. 68 | * In the new string, characters of aString that require URL encoding are replaced with the format %xx, where xx is the hexadecimal value of the character code in the Unicode character set.This format is used to transmit information appended to a URL during, for example, execution of the GET method.Use the unescape() global function to translate the string back into its original format. Returns a string which is aString URL-encoded. 69 | * @param aString The string to be encoded. 70 | */ 71 | declare function escape(aString: string): string 72 | 73 | /** 74 | * Evaluates its argument as a JavaScript script, and returns the result of evaluation. 75 | * You can pass the result of an object's toSource() method to reconstruct that object. 76 | * @param stringExpression The string to evaluate. 77 | */ 78 | declare function eval(stringExpression: string): any 79 | 80 | /** 81 | * Evaluates an expression and reports whether the result is a finite number. 82 | * Returns true if the expression is a finite number, false otherwise. False if the value is infinity or negative infinity. 83 | * @param expression Any valid JavaScript expression. 84 | */ 85 | declare function isFinite(expression: number): boolean 86 | 87 | /** 88 | * Evaluates an expression and reports whether the result is "Not-a-Number" (NaN). 89 | * Returns true if the result of evaluation is not a number (NaN), false if the value is a number. 90 | * @param expression Any valid JavaScript expression. 91 | */ 92 | declare function isNaN(expression: number): boolean 93 | 94 | /** 95 | * Returns true if the supplied string is a valid XML name. 96 | * @param name The XML name to test. 97 | */ 98 | declare function isXMLName(name: string): boolean 99 | 100 | /** 101 | * Localizes a ZString-encoded string and merges additional arguments into the string. 102 | * @param what The string to localize. A ZString-encoded string that can contain placeholder for additional arguments in the form %1 to %n. 103 | * @param arguments Optional argument(s) to be merged into the string. There may be more than one argument. 104 | */ 105 | declare function localize(what: string, ...arguments: any[]): string 106 | 107 | /** 108 | * Extracts a floating-point number from a string. 109 | * Parses a string to find the first set of characters that can be converted to a floating point number, and returns that number, or NaN if it does not encounter characters that it can converted to a number.The function supports exponential notation. 110 | * @param text The string from which to extract a floating point number. 111 | */ 112 | declare function parseFloat(text: string): number 113 | 114 | /** 115 | * Extracts an integer from a string. 116 | * Parses a string to find the first set of characters, in a specified base, that can be converted to an integer, and returns that integer, or NaN if it does not encounter characters that it can convert to a number. 117 | * @param text The string from which to extract an integer. 118 | * @param base The base of the string to parse (from base 2 to base 36). If not supplied, base is determined by the format of string. 119 | */ 120 | declare function parseInt(text: string, base?: number): number 121 | 122 | /** 123 | * Displays a dialog allowing the user to enter text 124 | * Returns null if the user cancelled the dialog, the text otherwise 125 | * @param prompt The text to display 126 | * @param default_ The default text to preset the edit field with 127 | * @param title The title of the dialog; 128 | */ 129 | declare function prompt(prompt: string, default_?: string, title?: string): string 130 | 131 | /** 132 | * Defines the default XML namespace. 133 | * This is a replacement function for the standard JavaScript statement set default xml namespace. 134 | * @param namespace The namespace to use. Omit this parameter to return to the empty namespace. This is either a Namespace object or a string. 135 | */ 136 | declare function setDefaultXMLNamespace(namespace: Namespace): void 137 | 138 | /** 139 | * Translates URL-encoded string into a regular string, and returns that string. 140 | * Use the escape() global function to URL-encode strings. 141 | * @param stringExpression The URL-encoded string to convert. 142 | */ 143 | declare function unescape(stringExpression: string): string 144 | 145 | /** 146 | * Creates a source code representation of the supplied argument, and returns it as a string. 147 | * @param what The object to uneval. 148 | */ 149 | declare function uneval(what: any): string -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 |

2 |


3 | 🔗 Download Release

4 |

5 |

 

6 | 7 | ## PremiereRemote - Customizable remote access to Adobe Premiere Pro CEP 8 | 9 | [![CEP Version](https://img.shields.io/badge/CEP%20Version-12.0-yellow)](https://github.com/Adobe-CEP/CEP-Resources/blob/master/CEP_12.x/Documentation/CEP%2012%20HTML%20Extension%20Cookbook.md) 10 | [![Premiere Pro Version](https://img.shields.io/badge/Premiere%20Pro%20Version-25.2-orange)](https://github.com/Adobe-CEP/CEP-Resources/blob/master/CEP_12.x/Documentation/CEP%2012%20HTML%20Extension%20Cookbook.md) 11 | [![Custom](https://img.shields.io/badge/Custom%20Functionality-Available-green)](https://github.com/sebinside/PremiereRemote/tree/custom/host/src) 12 | [![Release](https://img.shields.io/github/v/release/sebinside/PremiereRemote)](https://github.com/sebinside/PremiereRemote/releases) 13 | 14 | Using the [CEP extension mechanism](https://github.com/Adobe-CEP), **PremiereRemote** provides a framework to trigger your own Premiere functionality from outside of Premiere, e.g., by using [AutoHotkey](https://autohotkey.com/). This is achieved by starting a local server inside of Premiere, allowing to trigger custom functionality using a local http request or with websockets. TL;DR: 15 | 16 | ![Overview](figure-light.png#gh-light-mode-only) 17 | ![Overview](figure-dark.png#gh-dark-mode-only) 18 | 19 | Let's take a custom function like locking a video track inside of Premiere Pro. Unfortunately, there are no shortcuts available without modification. With CEP, you can define your own javascript function using extendscript: 20 | 21 | ```js 22 | function lockVideoLayer(layerNumber) { 23 | app.enableQE(); 24 | var activeSequence = qe.project.getActiveSequence(); 25 | var someTrack = activeSequence.getVideoTrackAt(layerNumber); 26 | someTrack.setLock(true); 27 | } 28 | ``` 29 | 30 | Using **PremiereRemote**, you can now easily trigger this function from outside of Premiere Pro with a http request. The required endpoint is generated automaticaly. In the case of the default port `8081` and the function `lockVideoLayer` presented above: 31 | 32 | ```bash 33 | $ curl "http://localhost:8081/lockVideoLayer?layerNumber=3" 34 | ``` 35 | 36 | Of course, you can also embed this line of code in a AHK-script or even remote control your Premiere instance from another computer. Sounds interesting? Let's get started! 37 | 38 | 39 | ## Installation 40 | 41 | This short guide will show how to install and use the **PremiereRemote** framework. 42 | 43 | 0. Preconditions: Please make sure that your Adobe Premiere Pro version matches the version shown in the README file. Other versions might work but could break things. Also, this framework requires [NodeJS](https://nodejs.org). Please install the current version, and verify that it is usable by, e.g., typing `npm --version`. 44 | 45 | 1. Start by cloning or downloading this repository. There is a [ready-to-use-version](https://github.com/sebinside/PremiereRemote/releases) available. 46 | 47 | 2. Follow [this documentation](https://github.com/Adobe-CEP/CEP-Resources/blob/master/CEP_12.x/Documentation/CEP%2012%20HTML%20Extension%20Cookbook.md) to install the extension. Basically, you have to: 48 | 49 | 1. Use `regedit` to allow the execution of unsigned Adobe Premiere extensions as described [here](https://github.com/Adobe-CEP/CEP-Resources/blob/master/CEP_12.x/Documentation/CEP%2012%20HTML%20Extension%20Cookbook.md#debugging-unsigned-extensions). 50 | 2. Copy the downloaded code inside of an extension folder, described [here](https://github.com/Adobe-CEP/CEP-Resources/blob/master/CEP_12.x/Documentation/CEP%2012%20HTML%20Extension%20Cookbook.md#extension-folders), e.g., `C:\Users\\AppData\Roaming\Adobe\CEP\extensions\PremiereRemote`. 51 | 52 | 3. Install the required dependencies to use **PremiereRemote**. 53 | 54 | 1. Open a console window in the `PremiereRemote\client` folder. Execute `npm i` to install all dependencies. These dependencies are used to run the local web server inside of Premiere. 55 | 2. Open a console window in the `PremiereRemote\host` folder. Execute `npm i` to install all dependencies. These dependencies are used for the development workflow. 56 | 3. In the same console window in the `PremiereRemote\host` folder, execute `npm run build`. This should generate a folder called `build`, where your custom functionality is contained. 57 | 58 | 4. (Re) start Adobe Premiere Pro. 59 | 60 | 3. Now, you should see the Framework under `Window` -> `Extensions`. If there is no entry, you might recheck the documentation and compare your premiere version / setup with the `manifest.xml`- file, located inside the `CSXS`- folder. 61 | 62 | 4. Double click the extension window. This should open the plugins `host`- folder. Inside the folder `src`, you can add your own functionality, e.g., in the `index.tsx`. Please stick to the format already used to ensure correct parsing and server setup from the framework-side. A semi-minimal `index.tsx`-file looks like this: 63 | 64 | ```js 65 | export const host = { 66 | kill: function () { 67 | // This method is only there for debugging purposes and shall not be replaced. 68 | }, 69 | yourNewFunction: function(param1, param2) { 70 | alert(param1 + " " + param2); 71 | } 72 | } 73 | ``` 74 | 75 | After making changes in any `.tsx` files, repeat the process of running `npm run build` from inside the `PremiereRemote\host` folder. You also have to close and repoen the **PremiereRemote** extension via `Window` -> `Extensions`. Note, that a restart of Premiere Pro is usually not required. 76 | 77 | There is more custom functionality available as inspiration or to directly use [here](https://github.com/sebinside/PremiereRemote/tree/custom/host/src). 78 | 79 | 80 | ## Usage 81 | 82 | Now, you are ready to call your own Premiere CEP functions, defined in the `host` variable of the `index.tsx`-file remotely. 83 | There are two ways to trigger PremiereRemote functionality from outside: Using HTTP requests or using WebSocket calls. 84 | 85 | ### HTTP Requests 86 | 87 | Test the endpoints in the browser of your choice, as shown above. For example, use Chrome and the url: 88 | 89 | ``` 90 | http://localhost:8081/yourNewFunction?param1=Hello¶m2=World 91 | ``` 92 | 93 | There is support for a [Swagger](https://swagger.io/)-based user interface (UI) to trigger your functionality. This UI is generated based on the annotations of the functions inside the `host` variable of the `index.tsx` file. By default, it is also hosted by the internal Premiere Pro server at `http://localhost:8081/api-docs/`. It is highly recommended to annotate your functions to simplify their usage (also, by you :)). 94 | 95 | On Windows 10 and later, you can easily trigger the URLs using the `curl`-functionality. [AutoHotkey](https://autohotkey.com/) code wrapping the `curl` process would look like this: 96 | 97 | ```autohotkey 98 | F11:: 99 | Run curl ""http://localhost:8081/yourNewFunction?param1=Hello¶m2=World"",,hide 100 | return 101 | ``` 102 | 103 | Quite easy, isn't it? Of course, you can change the port on your localhost. Have a look at the `index.html`- file for this. Also, AutoHotkey is only one example on how your custom Premiere Pro functionality can be called. Any application that can execute HTTP-requests is capable of triggering your functions. 104 | 105 | Additionally, it is possible to return values from inside of Premiere Pro, by returning their serialized representation at the end of a function inside the `index.tsx` file. An example JSON-based result can look like this: 106 | 107 | ```javascript 108 | {"message":"ok.","result":"5"} 109 | ``` 110 | 111 | ### WebSocket 112 | 113 | Since the release of `v2.1.0`, a WebSocket server was added to PremiereRemote. 114 | This enables you to trigger CEP code with minimal delay, e.g., when integrating PremiereRemote with Controller Hardware like the Elgato Stream Deck +. 115 | Any function that can be called via HTTP (see above) can also be called via WebSocket using port `8082` by default. 116 | See this simple example: 117 | 118 | ```javascript 119 | import WebSocket from 'ws'; 120 | const websocketAddress = 'ws://localhost:8082'; 121 | const ws = new WebSocket(websocketAddress); 122 | ws.send(`yourNewFunction,Hello,World`); 123 | ``` 124 | 125 | This code snippet would connect to the WebSocket server and call a CEP function named `yourNewFunction` with the parameters `Hello` and `World`. Any number of parameters (including zero) are allowed. 126 | 127 | ## Development 128 | 129 | Here is my workflow for easy development and debugging of your own [CEP](https://github.com/Adobe-CEP)-based functionality: 130 | 131 | 1. Start developing your new function using the [ExtendScript Debugger](https://marketplace.visualstudio.com/items?itemName=Adobe.extendscript-debug) extension for [Visual Studio Code](https://code.visualstudio.com/). Just specify Adobe Premiere as targed and you're ready to go with your own javascript CEP code. 132 | 2. After finishing with the development and testing of your new function, copy & paste the code inside the `index.tsx`-file. Alternatively, you can use multiple files to organize your code, as demonstrated [here](https://github.com/sebinside/PremiereRemote/tree/custom/host/src). 133 | 3. After making changes in any `.tsx` files, repeat the process of running `npm run build` from inside the `PremiereRemote\host` folder. 134 | 4. Then, reopen the **PremiereRemote** extension via `Window` -> `Extensions` and test it again, e.g., by using a browser, as shown above. 135 | 5. Optional: This extension enables debugging by default. Using chrome web debugger, you can simply connect to `http://localhost:8708` (by default) and see the javascript console output in real time (see the `.debug` file). 136 | 137 | Custom functionality inside the `host` folder is written in TypeScript and is based on [Types-for-Adobe](https://github.com/pravdomil/Types-for-Adobe). 138 | 139 | ## More 140 | 141 | If you want learn more about using the Adobe CEP SDK or AutoHotkey, have a look at this: 142 | 143 | * Adobe CEP Premiere Samples: https://github.com/Adobe-CEP/Samples/blob/master/PProPanel/jsx/PPRO/Premiere.jsx 144 | * Premiere On Script, a Premiere CEP YouTube channel: https://www.youtube.com/channel/UCmq_t_-4GLFu_nYaEDDModw 145 | * Taran Van Hemert, a macro specialist: https://www.youtube.com/user/TaranVH 146 | * And my own twitch channel, were I develop with these techniques, sometimes: https://www.twitch.tv/skate702 147 | 148 | If there are more questions, you can contact me on [Twitter](https://twitter.com/skate702) or via [mail](mailto:hi@sebinside.de). 149 | -------------------------------------------------------------------------------- /host/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "host", 3 | "version": "1.0.0", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "host", 9 | "version": "1.0.0", 10 | "license": "ISC", 11 | "devDependencies": { 12 | "esbuild": "^0.14.36", 13 | "typescript": "^5.3.3" 14 | } 15 | }, 16 | "node_modules/esbuild": { 17 | "version": "0.14.36", 18 | "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.36.tgz", 19 | "integrity": "sha512-HhFHPiRXGYOCRlrhpiVDYKcFJRdO0sBElZ668M4lh2ER0YgnkLxECuFe7uWCf23FrcLc59Pqr7dHkTqmRPDHmw==", 20 | "dev": true, 21 | "hasInstallScript": true, 22 | "bin": { 23 | "esbuild": "bin/esbuild" 24 | }, 25 | "engines": { 26 | "node": ">=12" 27 | }, 28 | "optionalDependencies": { 29 | "esbuild-android-64": "0.14.36", 30 | "esbuild-android-arm64": "0.14.36", 31 | "esbuild-darwin-64": "0.14.36", 32 | "esbuild-darwin-arm64": "0.14.36", 33 | "esbuild-freebsd-64": "0.14.36", 34 | "esbuild-freebsd-arm64": "0.14.36", 35 | "esbuild-linux-32": "0.14.36", 36 | "esbuild-linux-64": "0.14.36", 37 | "esbuild-linux-arm": "0.14.36", 38 | "esbuild-linux-arm64": "0.14.36", 39 | "esbuild-linux-mips64le": "0.14.36", 40 | "esbuild-linux-ppc64le": "0.14.36", 41 | "esbuild-linux-riscv64": "0.14.36", 42 | "esbuild-linux-s390x": "0.14.36", 43 | "esbuild-netbsd-64": "0.14.36", 44 | "esbuild-openbsd-64": "0.14.36", 45 | "esbuild-sunos-64": "0.14.36", 46 | "esbuild-windows-32": "0.14.36", 47 | "esbuild-windows-64": "0.14.36", 48 | "esbuild-windows-arm64": "0.14.36" 49 | } 50 | }, 51 | "node_modules/esbuild-android-64": { 52 | "version": "0.14.36", 53 | "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.36.tgz", 54 | "integrity": "sha512-jwpBhF1jmo0tVCYC/ORzVN+hyVcNZUWuozGcLHfod0RJCedTDTvR4nwlTXdx1gtncDqjk33itjO+27OZHbiavw==", 55 | "cpu": [ 56 | "x64" 57 | ], 58 | "dev": true, 59 | "optional": true, 60 | "os": [ 61 | "android" 62 | ], 63 | "engines": { 64 | "node": ">=12" 65 | } 66 | }, 67 | "node_modules/esbuild-android-arm64": { 68 | "version": "0.14.36", 69 | "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.36.tgz", 70 | "integrity": "sha512-/hYkyFe7x7Yapmfv4X/tBmyKnggUmdQmlvZ8ZlBnV4+PjisrEhAvC3yWpURuD9XoB8Wa1d5dGkTsF53pIvpjsg==", 71 | "cpu": [ 72 | "arm64" 73 | ], 74 | "dev": true, 75 | "optional": true, 76 | "os": [ 77 | "android" 78 | ], 79 | "engines": { 80 | "node": ">=12" 81 | } 82 | }, 83 | "node_modules/esbuild-darwin-64": { 84 | "version": "0.14.36", 85 | "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.36.tgz", 86 | "integrity": "sha512-kkl6qmV0dTpyIMKagluzYqlc1vO0ecgpviK/7jwPbRDEv5fejRTaBBEE2KxEQbTHcLhiiDbhG7d5UybZWo/1zQ==", 87 | "cpu": [ 88 | "x64" 89 | ], 90 | "dev": true, 91 | "optional": true, 92 | "os": [ 93 | "darwin" 94 | ], 95 | "engines": { 96 | "node": ">=12" 97 | } 98 | }, 99 | "node_modules/esbuild-darwin-arm64": { 100 | "version": "0.14.36", 101 | "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.36.tgz", 102 | "integrity": "sha512-q8fY4r2Sx6P0Pr3VUm//eFYKVk07C5MHcEinU1BjyFnuYz4IxR/03uBbDwluR6ILIHnZTE7AkTUWIdidRi1Jjw==", 103 | "cpu": [ 104 | "arm64" 105 | ], 106 | "dev": true, 107 | "optional": true, 108 | "os": [ 109 | "darwin" 110 | ], 111 | "engines": { 112 | "node": ">=12" 113 | } 114 | }, 115 | "node_modules/esbuild-freebsd-64": { 116 | "version": "0.14.36", 117 | "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.36.tgz", 118 | "integrity": "sha512-Hn8AYuxXXRptybPqoMkga4HRFE7/XmhtlQjXFHoAIhKUPPMeJH35GYEUWGbjteai9FLFvBAjEAlwEtSGxnqWww==", 119 | "cpu": [ 120 | "x64" 121 | ], 122 | "dev": true, 123 | "optional": true, 124 | "os": [ 125 | "freebsd" 126 | ], 127 | "engines": { 128 | "node": ">=12" 129 | } 130 | }, 131 | "node_modules/esbuild-freebsd-arm64": { 132 | "version": "0.14.36", 133 | "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.36.tgz", 134 | "integrity": "sha512-S3C0attylLLRiCcHiJd036eDEMOY32+h8P+jJ3kTcfhJANNjP0TNBNL30TZmEdOSx/820HJFgRrqpNAvTbjnDA==", 135 | "cpu": [ 136 | "arm64" 137 | ], 138 | "dev": true, 139 | "optional": true, 140 | "os": [ 141 | "freebsd" 142 | ], 143 | "engines": { 144 | "node": ">=12" 145 | } 146 | }, 147 | "node_modules/esbuild-linux-32": { 148 | "version": "0.14.36", 149 | "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.36.tgz", 150 | "integrity": "sha512-Eh9OkyTrEZn9WGO4xkI3OPPpUX7p/3QYvdG0lL4rfr73Ap2HAr6D9lP59VMF64Ex01LhHSXwIsFG/8AQjh6eNw==", 151 | "cpu": [ 152 | "ia32" 153 | ], 154 | "dev": true, 155 | "optional": true, 156 | "os": [ 157 | "linux" 158 | ], 159 | "engines": { 160 | "node": ">=12" 161 | } 162 | }, 163 | "node_modules/esbuild-linux-64": { 164 | "version": "0.14.36", 165 | "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.36.tgz", 166 | "integrity": "sha512-vFVFS5ve7PuwlfgoWNyRccGDi2QTNkQo/2k5U5ttVD0jRFaMlc8UQee708fOZA6zTCDy5RWsT5MJw3sl2X6KDg==", 167 | "cpu": [ 168 | "x64" 169 | ], 170 | "dev": true, 171 | "optional": true, 172 | "os": [ 173 | "linux" 174 | ], 175 | "engines": { 176 | "node": ">=12" 177 | } 178 | }, 179 | "node_modules/esbuild-linux-arm": { 180 | "version": "0.14.36", 181 | "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.36.tgz", 182 | "integrity": "sha512-NhgU4n+NCsYgt7Hy61PCquEz5aevI6VjQvxwBxtxrooXsxt5b2xtOUXYZe04JxqQo+XZk3d1gcr7pbV9MAQ/Lg==", 183 | "cpu": [ 184 | "arm" 185 | ], 186 | "dev": true, 187 | "optional": true, 188 | "os": [ 189 | "linux" 190 | ], 191 | "engines": { 192 | "node": ">=12" 193 | } 194 | }, 195 | "node_modules/esbuild-linux-arm64": { 196 | "version": "0.14.36", 197 | "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.36.tgz", 198 | "integrity": "sha512-24Vq1M7FdpSmaTYuu1w0Hdhiqkbto1I5Pjyi+4Cdw5fJKGlwQuw+hWynTcRI/cOZxBcBpP21gND7W27gHAiftw==", 199 | "cpu": [ 200 | "arm64" 201 | ], 202 | "dev": true, 203 | "optional": true, 204 | "os": [ 205 | "linux" 206 | ], 207 | "engines": { 208 | "node": ">=12" 209 | } 210 | }, 211 | "node_modules/esbuild-linux-mips64le": { 212 | "version": "0.14.36", 213 | "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.36.tgz", 214 | "integrity": "sha512-hZUeTXvppJN+5rEz2EjsOFM9F1bZt7/d2FUM1lmQo//rXh1RTFYzhC0txn7WV0/jCC7SvrGRaRz0NMsRPf8SIA==", 215 | "cpu": [ 216 | "mips64el" 217 | ], 218 | "dev": true, 219 | "optional": true, 220 | "os": [ 221 | "linux" 222 | ], 223 | "engines": { 224 | "node": ">=12" 225 | } 226 | }, 227 | "node_modules/esbuild-linux-ppc64le": { 228 | "version": "0.14.36", 229 | "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.36.tgz", 230 | "integrity": "sha512-1Bg3QgzZjO+QtPhP9VeIBhAduHEc2kzU43MzBnMwpLSZ890azr4/A9Dganun8nsqD/1TBcqhId0z4mFDO8FAvg==", 231 | "cpu": [ 232 | "ppc64" 233 | ], 234 | "dev": true, 235 | "optional": true, 236 | "os": [ 237 | "linux" 238 | ], 239 | "engines": { 240 | "node": ">=12" 241 | } 242 | }, 243 | "node_modules/esbuild-linux-riscv64": { 244 | "version": "0.14.36", 245 | "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.36.tgz", 246 | "integrity": "sha512-dOE5pt3cOdqEhaufDRzNCHf5BSwxgygVak9UR7PH7KPVHwSTDAZHDoEjblxLqjJYpc5XaU9+gKJ9F8mp9r5I4A==", 247 | "cpu": [ 248 | "riscv64" 249 | ], 250 | "dev": true, 251 | "optional": true, 252 | "os": [ 253 | "linux" 254 | ], 255 | "engines": { 256 | "node": ">=12" 257 | } 258 | }, 259 | "node_modules/esbuild-linux-s390x": { 260 | "version": "0.14.36", 261 | "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.36.tgz", 262 | "integrity": "sha512-g4FMdh//BBGTfVHjF6MO7Cz8gqRoDPzXWxRvWkJoGroKA18G9m0wddvPbEqcQf5Tbt2vSc1CIgag7cXwTmoTXg==", 263 | "cpu": [ 264 | "s390x" 265 | ], 266 | "dev": true, 267 | "optional": true, 268 | "os": [ 269 | "linux" 270 | ], 271 | "engines": { 272 | "node": ">=12" 273 | } 274 | }, 275 | "node_modules/esbuild-netbsd-64": { 276 | "version": "0.14.36", 277 | "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.36.tgz", 278 | "integrity": "sha512-UB2bVImxkWk4vjnP62ehFNZ73lQY1xcnL5ZNYF3x0AG+j8HgdkNF05v67YJdCIuUJpBuTyCK8LORCYo9onSW+A==", 279 | "cpu": [ 280 | "x64" 281 | ], 282 | "dev": true, 283 | "optional": true, 284 | "os": [ 285 | "netbsd" 286 | ], 287 | "engines": { 288 | "node": ">=12" 289 | } 290 | }, 291 | "node_modules/esbuild-openbsd-64": { 292 | "version": "0.14.36", 293 | "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.36.tgz", 294 | "integrity": "sha512-NvGB2Chf8GxuleXRGk8e9zD3aSdRO5kLt9coTQbCg7WMGXeX471sBgh4kSg8pjx0yTXRt0MlrUDnjVYnetyivg==", 295 | "cpu": [ 296 | "x64" 297 | ], 298 | "dev": true, 299 | "optional": true, 300 | "os": [ 301 | "openbsd" 302 | ], 303 | "engines": { 304 | "node": ">=12" 305 | } 306 | }, 307 | "node_modules/esbuild-sunos-64": { 308 | "version": "0.14.36", 309 | "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.36.tgz", 310 | "integrity": "sha512-VkUZS5ftTSjhRjuRLp+v78auMO3PZBXu6xl4ajomGenEm2/rGuWlhFSjB7YbBNErOchj51Jb2OK8lKAo8qdmsQ==", 311 | "cpu": [ 312 | "x64" 313 | ], 314 | "dev": true, 315 | "optional": true, 316 | "os": [ 317 | "sunos" 318 | ], 319 | "engines": { 320 | "node": ">=12" 321 | } 322 | }, 323 | "node_modules/esbuild-windows-32": { 324 | "version": "0.14.36", 325 | "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.36.tgz", 326 | "integrity": "sha512-bIar+A6hdytJjZrDxfMBUSEHHLfx3ynoEZXx/39nxy86pX/w249WZm8Bm0dtOAByAf4Z6qV0LsnTIJHiIqbw0w==", 327 | "cpu": [ 328 | "ia32" 329 | ], 330 | "dev": true, 331 | "optional": true, 332 | "os": [ 333 | "win32" 334 | ], 335 | "engines": { 336 | "node": ">=12" 337 | } 338 | }, 339 | "node_modules/esbuild-windows-64": { 340 | "version": "0.14.36", 341 | "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.36.tgz", 342 | "integrity": "sha512-+p4MuRZekVChAeueT1Y9LGkxrT5x7YYJxYE8ZOTcEfeUUN43vktSn6hUNsvxzzATrSgq5QqRdllkVBxWZg7KqQ==", 343 | "cpu": [ 344 | "x64" 345 | ], 346 | "dev": true, 347 | "optional": true, 348 | "os": [ 349 | "win32" 350 | ], 351 | "engines": { 352 | "node": ">=12" 353 | } 354 | }, 355 | "node_modules/esbuild-windows-arm64": { 356 | "version": "0.14.36", 357 | "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.36.tgz", 358 | "integrity": "sha512-fBB4WlDqV1m18EF/aheGYQkQZHfPHiHJSBYzXIo8yKehek+0BtBwo/4PNwKGJ5T0YK0oc8pBKjgwPbzSrPLb+Q==", 359 | "cpu": [ 360 | "arm64" 361 | ], 362 | "dev": true, 363 | "optional": true, 364 | "os": [ 365 | "win32" 366 | ], 367 | "engines": { 368 | "node": ">=12" 369 | } 370 | }, 371 | "node_modules/typescript": { 372 | "version": "5.3.3", 373 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", 374 | "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", 375 | "dev": true, 376 | "bin": { 377 | "tsc": "bin/tsc", 378 | "tsserver": "bin/tsserver" 379 | }, 380 | "engines": { 381 | "node": ">=14.17" 382 | } 383 | } 384 | }, 385 | "dependencies": { 386 | "esbuild": { 387 | "version": "0.14.36", 388 | "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.36.tgz", 389 | "integrity": "sha512-HhFHPiRXGYOCRlrhpiVDYKcFJRdO0sBElZ668M4lh2ER0YgnkLxECuFe7uWCf23FrcLc59Pqr7dHkTqmRPDHmw==", 390 | "dev": true, 391 | "requires": { 392 | "esbuild-android-64": "0.14.36", 393 | "esbuild-android-arm64": "0.14.36", 394 | "esbuild-darwin-64": "0.14.36", 395 | "esbuild-darwin-arm64": "0.14.36", 396 | "esbuild-freebsd-64": "0.14.36", 397 | "esbuild-freebsd-arm64": "0.14.36", 398 | "esbuild-linux-32": "0.14.36", 399 | "esbuild-linux-64": "0.14.36", 400 | "esbuild-linux-arm": "0.14.36", 401 | "esbuild-linux-arm64": "0.14.36", 402 | "esbuild-linux-mips64le": "0.14.36", 403 | "esbuild-linux-ppc64le": "0.14.36", 404 | "esbuild-linux-riscv64": "0.14.36", 405 | "esbuild-linux-s390x": "0.14.36", 406 | "esbuild-netbsd-64": "0.14.36", 407 | "esbuild-openbsd-64": "0.14.36", 408 | "esbuild-sunos-64": "0.14.36", 409 | "esbuild-windows-32": "0.14.36", 410 | "esbuild-windows-64": "0.14.36", 411 | "esbuild-windows-arm64": "0.14.36" 412 | } 413 | }, 414 | "esbuild-android-64": { 415 | "version": "0.14.36", 416 | "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.36.tgz", 417 | "integrity": "sha512-jwpBhF1jmo0tVCYC/ORzVN+hyVcNZUWuozGcLHfod0RJCedTDTvR4nwlTXdx1gtncDqjk33itjO+27OZHbiavw==", 418 | "dev": true, 419 | "optional": true 420 | }, 421 | "esbuild-android-arm64": { 422 | "version": "0.14.36", 423 | "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.36.tgz", 424 | "integrity": "sha512-/hYkyFe7x7Yapmfv4X/tBmyKnggUmdQmlvZ8ZlBnV4+PjisrEhAvC3yWpURuD9XoB8Wa1d5dGkTsF53pIvpjsg==", 425 | "dev": true, 426 | "optional": true 427 | }, 428 | "esbuild-darwin-64": { 429 | "version": "0.14.36", 430 | "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.36.tgz", 431 | "integrity": "sha512-kkl6qmV0dTpyIMKagluzYqlc1vO0ecgpviK/7jwPbRDEv5fejRTaBBEE2KxEQbTHcLhiiDbhG7d5UybZWo/1zQ==", 432 | "dev": true, 433 | "optional": true 434 | }, 435 | "esbuild-darwin-arm64": { 436 | "version": "0.14.36", 437 | "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.36.tgz", 438 | "integrity": "sha512-q8fY4r2Sx6P0Pr3VUm//eFYKVk07C5MHcEinU1BjyFnuYz4IxR/03uBbDwluR6ILIHnZTE7AkTUWIdidRi1Jjw==", 439 | "dev": true, 440 | "optional": true 441 | }, 442 | "esbuild-freebsd-64": { 443 | "version": "0.14.36", 444 | "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.36.tgz", 445 | "integrity": "sha512-Hn8AYuxXXRptybPqoMkga4HRFE7/XmhtlQjXFHoAIhKUPPMeJH35GYEUWGbjteai9FLFvBAjEAlwEtSGxnqWww==", 446 | "dev": true, 447 | "optional": true 448 | }, 449 | "esbuild-freebsd-arm64": { 450 | "version": "0.14.36", 451 | "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.36.tgz", 452 | "integrity": "sha512-S3C0attylLLRiCcHiJd036eDEMOY32+h8P+jJ3kTcfhJANNjP0TNBNL30TZmEdOSx/820HJFgRrqpNAvTbjnDA==", 453 | "dev": true, 454 | "optional": true 455 | }, 456 | "esbuild-linux-32": { 457 | "version": "0.14.36", 458 | "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.36.tgz", 459 | "integrity": "sha512-Eh9OkyTrEZn9WGO4xkI3OPPpUX7p/3QYvdG0lL4rfr73Ap2HAr6D9lP59VMF64Ex01LhHSXwIsFG/8AQjh6eNw==", 460 | "dev": true, 461 | "optional": true 462 | }, 463 | "esbuild-linux-64": { 464 | "version": "0.14.36", 465 | "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.36.tgz", 466 | "integrity": "sha512-vFVFS5ve7PuwlfgoWNyRccGDi2QTNkQo/2k5U5ttVD0jRFaMlc8UQee708fOZA6zTCDy5RWsT5MJw3sl2X6KDg==", 467 | "dev": true, 468 | "optional": true 469 | }, 470 | "esbuild-linux-arm": { 471 | "version": "0.14.36", 472 | "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.36.tgz", 473 | "integrity": "sha512-NhgU4n+NCsYgt7Hy61PCquEz5aevI6VjQvxwBxtxrooXsxt5b2xtOUXYZe04JxqQo+XZk3d1gcr7pbV9MAQ/Lg==", 474 | "dev": true, 475 | "optional": true 476 | }, 477 | "esbuild-linux-arm64": { 478 | "version": "0.14.36", 479 | "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.36.tgz", 480 | "integrity": "sha512-24Vq1M7FdpSmaTYuu1w0Hdhiqkbto1I5Pjyi+4Cdw5fJKGlwQuw+hWynTcRI/cOZxBcBpP21gND7W27gHAiftw==", 481 | "dev": true, 482 | "optional": true 483 | }, 484 | "esbuild-linux-mips64le": { 485 | "version": "0.14.36", 486 | "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.36.tgz", 487 | "integrity": "sha512-hZUeTXvppJN+5rEz2EjsOFM9F1bZt7/d2FUM1lmQo//rXh1RTFYzhC0txn7WV0/jCC7SvrGRaRz0NMsRPf8SIA==", 488 | "dev": true, 489 | "optional": true 490 | }, 491 | "esbuild-linux-ppc64le": { 492 | "version": "0.14.36", 493 | "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.36.tgz", 494 | "integrity": "sha512-1Bg3QgzZjO+QtPhP9VeIBhAduHEc2kzU43MzBnMwpLSZ890azr4/A9Dganun8nsqD/1TBcqhId0z4mFDO8FAvg==", 495 | "dev": true, 496 | "optional": true 497 | }, 498 | "esbuild-linux-riscv64": { 499 | "version": "0.14.36", 500 | "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.36.tgz", 501 | "integrity": "sha512-dOE5pt3cOdqEhaufDRzNCHf5BSwxgygVak9UR7PH7KPVHwSTDAZHDoEjblxLqjJYpc5XaU9+gKJ9F8mp9r5I4A==", 502 | "dev": true, 503 | "optional": true 504 | }, 505 | "esbuild-linux-s390x": { 506 | "version": "0.14.36", 507 | "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.36.tgz", 508 | "integrity": "sha512-g4FMdh//BBGTfVHjF6MO7Cz8gqRoDPzXWxRvWkJoGroKA18G9m0wddvPbEqcQf5Tbt2vSc1CIgag7cXwTmoTXg==", 509 | "dev": true, 510 | "optional": true 511 | }, 512 | "esbuild-netbsd-64": { 513 | "version": "0.14.36", 514 | "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.36.tgz", 515 | "integrity": "sha512-UB2bVImxkWk4vjnP62ehFNZ73lQY1xcnL5ZNYF3x0AG+j8HgdkNF05v67YJdCIuUJpBuTyCK8LORCYo9onSW+A==", 516 | "dev": true, 517 | "optional": true 518 | }, 519 | "esbuild-openbsd-64": { 520 | "version": "0.14.36", 521 | "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.36.tgz", 522 | "integrity": "sha512-NvGB2Chf8GxuleXRGk8e9zD3aSdRO5kLt9coTQbCg7WMGXeX471sBgh4kSg8pjx0yTXRt0MlrUDnjVYnetyivg==", 523 | "dev": true, 524 | "optional": true 525 | }, 526 | "esbuild-sunos-64": { 527 | "version": "0.14.36", 528 | "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.36.tgz", 529 | "integrity": "sha512-VkUZS5ftTSjhRjuRLp+v78auMO3PZBXu6xl4ajomGenEm2/rGuWlhFSjB7YbBNErOchj51Jb2OK8lKAo8qdmsQ==", 530 | "dev": true, 531 | "optional": true 532 | }, 533 | "esbuild-windows-32": { 534 | "version": "0.14.36", 535 | "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.36.tgz", 536 | "integrity": "sha512-bIar+A6hdytJjZrDxfMBUSEHHLfx3ynoEZXx/39nxy86pX/w249WZm8Bm0dtOAByAf4Z6qV0LsnTIJHiIqbw0w==", 537 | "dev": true, 538 | "optional": true 539 | }, 540 | "esbuild-windows-64": { 541 | "version": "0.14.36", 542 | "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.36.tgz", 543 | "integrity": "sha512-+p4MuRZekVChAeueT1Y9LGkxrT5x7YYJxYE8ZOTcEfeUUN43vktSn6hUNsvxzzATrSgq5QqRdllkVBxWZg7KqQ==", 544 | "dev": true, 545 | "optional": true 546 | }, 547 | "esbuild-windows-arm64": { 548 | "version": "0.14.36", 549 | "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.36.tgz", 550 | "integrity": "sha512-fBB4WlDqV1m18EF/aheGYQkQZHfPHiHJSBYzXIo8yKehek+0BtBwo/4PNwKGJ5T0YK0oc8pBKjgwPbzSrPLb+Q==", 551 | "dev": true, 552 | "optional": true 553 | }, 554 | "typescript": { 555 | "version": "5.3.3", 556 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", 557 | "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", 558 | "dev": true 559 | } 560 | } 561 | } 562 | -------------------------------------------------------------------------------- /client/CSInterface.js: -------------------------------------------------------------------------------- 1 | /************************************************************************************************** 2 | * 3 | * ADOBE SYSTEMS INCORPORATED 4 | * Copyright 2020 Adobe Systems Incorporated 5 | * All Rights Reserved. 6 | * 7 | * NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the 8 | * terms of the Adobe license agreement accompanying it. If you have received this file from a 9 | * source other than Adobe, then your use, modification, or distribution of it requires the prior 10 | * written permission of Adobe. 11 | * 12 | **************************************************************************************************/ 13 | 14 | /** CSInterface - v12.0.0 */ 15 | 16 | /** 17 | * Stores constants for the window types supported by the CSXS infrastructure. 18 | */ 19 | function CSXSWindowType() 20 | { 21 | } 22 | 23 | /** Constant for the CSXS window type Panel. */ 24 | CSXSWindowType._PANEL = "Panel"; 25 | 26 | /** Constant for the CSXS window type Modeless. */ 27 | CSXSWindowType._MODELESS = "Modeless"; 28 | 29 | /** Constant for the CSXS window type ModalDialog. */ 30 | CSXSWindowType._MODAL_DIALOG = "ModalDialog"; 31 | 32 | /** EvalScript error message */ 33 | EvalScript_ErrMessage = "EvalScript error."; 34 | 35 | /** 36 | * @class Version 37 | * Defines a version number with major, minor, micro, and special 38 | * components. The major, minor and micro values are numeric; the special 39 | * value can be any string. 40 | * 41 | * @param major The major version component, a positive integer up to nine digits long. 42 | * @param minor The minor version component, a positive integer up to nine digits long. 43 | * @param micro The micro version component, a positive integer up to nine digits long. 44 | * @param special The special version component, an arbitrary string. 45 | * 46 | * @return A new \c Version object. 47 | */ 48 | function Version(major, minor, micro, special) 49 | { 50 | this.major = major; 51 | this.minor = minor; 52 | this.micro = micro; 53 | this.special = special; 54 | } 55 | 56 | /** 57 | * The maximum value allowed for a numeric version component. 58 | * This reflects the maximum value allowed in PlugPlug and the manifest schema. 59 | */ 60 | Version.MAX_NUM = 999999999; 61 | 62 | /** 63 | * @class VersionBound 64 | * Defines a boundary for a version range, which associates a \c Version object 65 | * with a flag for whether it is an inclusive or exclusive boundary. 66 | * 67 | * @param version The \c #Version object. 68 | * @param inclusive True if this boundary is inclusive, false if it is exclusive. 69 | * 70 | * @return A new \c VersionBound object. 71 | */ 72 | function VersionBound(version, inclusive) 73 | { 74 | this.version = version; 75 | this.inclusive = inclusive; 76 | } 77 | 78 | /** 79 | * @class VersionRange 80 | * Defines a range of versions using a lower boundary and optional upper boundary. 81 | * 82 | * @param lowerBound The \c #VersionBound object. 83 | * @param upperBound The \c #VersionBound object, or null for a range with no upper boundary. 84 | * 85 | * @return A new \c VersionRange object. 86 | */ 87 | function VersionRange(lowerBound, upperBound) 88 | { 89 | this.lowerBound = lowerBound; 90 | this.upperBound = upperBound; 91 | } 92 | 93 | /** 94 | * @class Runtime 95 | * Represents a runtime related to the CEP infrastructure. 96 | * Extensions can declare dependencies on particular 97 | * CEP runtime versions in the extension manifest. 98 | * 99 | * @param name The runtime name. 100 | * @param version A \c #VersionRange object that defines a range of valid versions. 101 | * 102 | * @return A new \c Runtime object. 103 | */ 104 | function Runtime(name, versionRange) 105 | { 106 | this.name = name; 107 | this.versionRange = versionRange; 108 | } 109 | 110 | /** 111 | * @class Extension 112 | * Encapsulates a CEP-based extension to an Adobe application. 113 | * 114 | * @param id The unique identifier of this extension. 115 | * @param name The localizable display name of this extension. 116 | * @param mainPath The path of the "index.html" file. 117 | * @param basePath The base path of this extension. 118 | * @param windowType The window type of the main window of this extension. 119 | Valid values are defined by \c #CSXSWindowType. 120 | * @param width The default width in pixels of the main window of this extension. 121 | * @param height The default height in pixels of the main window of this extension. 122 | * @param minWidth The minimum width in pixels of the main window of this extension. 123 | * @param minHeight The minimum height in pixels of the main window of this extension. 124 | * @param maxWidth The maximum width in pixels of the main window of this extension. 125 | * @param maxHeight The maximum height in pixels of the main window of this extension. 126 | * @param defaultExtensionDataXml The extension data contained in the default \c ExtensionDispatchInfo section of the extension manifest. 127 | * @param specialExtensionDataXml The extension data contained in the application-specific \c ExtensionDispatchInfo section of the extension manifest. 128 | * @param requiredRuntimeList An array of \c Runtime objects for runtimes required by this extension. 129 | * @param isAutoVisible True if this extension is visible on loading. 130 | * @param isPluginExtension True if this extension has been deployed in the Plugins folder of the host application. 131 | * 132 | * @return A new \c Extension object. 133 | */ 134 | function Extension(id, name, mainPath, basePath, windowType, width, height, minWidth, minHeight, maxWidth, maxHeight, 135 | defaultExtensionDataXml, specialExtensionDataXml, requiredRuntimeList, isAutoVisible, isPluginExtension) 136 | { 137 | this.id = id; 138 | this.name = name; 139 | this.mainPath = mainPath; 140 | this.basePath = basePath; 141 | this.windowType = windowType; 142 | this.width = width; 143 | this.height = height; 144 | this.minWidth = minWidth; 145 | this.minHeight = minHeight; 146 | this.maxWidth = maxWidth; 147 | this.maxHeight = maxHeight; 148 | this.defaultExtensionDataXml = defaultExtensionDataXml; 149 | this.specialExtensionDataXml = specialExtensionDataXml; 150 | this.requiredRuntimeList = requiredRuntimeList; 151 | this.isAutoVisible = isAutoVisible; 152 | this.isPluginExtension = isPluginExtension; 153 | } 154 | 155 | /** 156 | * @class CSEvent 157 | * A standard JavaScript event, the base class for CEP events. 158 | * 159 | * @param type The name of the event type. 160 | * @param scope The scope of event, can be "GLOBAL" or "APPLICATION". 161 | * @param appId The unique identifier of the application that generated the event. 162 | * @param extensionId The unique identifier of the extension that generated the event. 163 | * 164 | * @return A new \c CSEvent object 165 | */ 166 | function CSEvent(type, scope, appId, extensionId) 167 | { 168 | this.type = type; 169 | this.scope = scope; 170 | this.appId = appId; 171 | this.extensionId = extensionId; 172 | } 173 | 174 | /** Event-specific data. */ 175 | CSEvent.prototype.data = ""; 176 | 177 | /** 178 | * @class SystemPath 179 | * Stores operating-system-specific location constants for use in the 180 | * \c #CSInterface.getSystemPath() method. 181 | * @return A new \c SystemPath object. 182 | */ 183 | function SystemPath() 184 | { 185 | } 186 | 187 | /** The path to user data. */ 188 | SystemPath.USER_DATA = "userData"; 189 | 190 | /** The path to common files for Adobe applications. */ 191 | SystemPath.COMMON_FILES = "commonFiles"; 192 | 193 | /** The path to the user's default document folder. */ 194 | SystemPath.MY_DOCUMENTS = "myDocuments"; 195 | 196 | /** @deprecated. Use \c #SystemPath.Extension. */ 197 | SystemPath.APPLICATION = "application"; 198 | 199 | /** The path to current extension. */ 200 | SystemPath.EXTENSION = "extension"; 201 | 202 | /** The path to hosting application's executable. */ 203 | SystemPath.HOST_APPLICATION = "hostApplication"; 204 | 205 | /** 206 | * @class ColorType 207 | * Stores color-type constants. 208 | */ 209 | function ColorType() 210 | { 211 | } 212 | 213 | /** RGB color type. */ 214 | ColorType.RGB = "rgb"; 215 | 216 | /** Gradient color type. */ 217 | ColorType.GRADIENT = "gradient"; 218 | 219 | /** Null color type. */ 220 | ColorType.NONE = "none"; 221 | 222 | /** 223 | * @class RGBColor 224 | * Stores an RGB color with red, green, blue, and alpha values. 225 | * All values are in the range [0.0 to 255.0]. Invalid numeric values are 226 | * converted to numbers within this range. 227 | * 228 | * @param red The red value, in the range [0.0 to 255.0]. 229 | * @param green The green value, in the range [0.0 to 255.0]. 230 | * @param blue The blue value, in the range [0.0 to 255.0]. 231 | * @param alpha The alpha (transparency) value, in the range [0.0 to 255.0]. 232 | * The default, 255.0, means that the color is fully opaque. 233 | * 234 | * @return A new RGBColor object. 235 | */ 236 | function RGBColor(red, green, blue, alpha) 237 | { 238 | this.red = red; 239 | this.green = green; 240 | this.blue = blue; 241 | this.alpha = alpha; 242 | } 243 | 244 | /** 245 | * @class Direction 246 | * A point value in which the y component is 0 and the x component 247 | * is positive or negative for a right or left direction, 248 | * or the x component is 0 and the y component is positive or negative for 249 | * an up or down direction. 250 | * 251 | * @param x The horizontal component of the point. 252 | * @param y The vertical component of the point. 253 | * 254 | * @return A new \c Direction object. 255 | */ 256 | function Direction(x, y) 257 | { 258 | this.x = x; 259 | this.y = y; 260 | } 261 | 262 | /** 263 | * @class GradientStop 264 | * Stores gradient stop information. 265 | * 266 | * @param offset The offset of the gradient stop, in the range [0.0 to 1.0]. 267 | * @param rgbColor The color of the gradient at this point, an \c #RGBColor object. 268 | * 269 | * @return GradientStop object. 270 | */ 271 | function GradientStop(offset, rgbColor) 272 | { 273 | this.offset = offset; 274 | this.rgbColor = rgbColor; 275 | } 276 | 277 | /** 278 | * @class GradientColor 279 | * Stores gradient color information. 280 | * 281 | * @param type The gradient type, must be "linear". 282 | * @param direction A \c #Direction object for the direction of the gradient 283 | (up, down, right, or left). 284 | * @param numStops The number of stops in the gradient. 285 | * @param gradientStopList An array of \c #GradientStop objects. 286 | * 287 | * @return A new \c GradientColor object. 288 | */ 289 | function GradientColor(type, direction, numStops, arrGradientStop) 290 | { 291 | this.type = type; 292 | this.direction = direction; 293 | this.numStops = numStops; 294 | this.arrGradientStop = arrGradientStop; 295 | } 296 | 297 | /** 298 | * @class UIColor 299 | * Stores color information, including the type, anti-alias level, and specific color 300 | * values in a color object of an appropriate type. 301 | * 302 | * @param type The color type, 1 for "rgb" and 2 for "gradient". 303 | The supplied color object must correspond to this type. 304 | * @param antialiasLevel The anti-alias level constant. 305 | * @param color A \c #RGBColor or \c #GradientColor object containing specific color information. 306 | * 307 | * @return A new \c UIColor object. 308 | */ 309 | function UIColor(type, antialiasLevel, color) 310 | { 311 | this.type = type; 312 | this.antialiasLevel = antialiasLevel; 313 | this.color = color; 314 | } 315 | 316 | /** 317 | * @class AppSkinInfo 318 | * Stores window-skin properties, such as color and font. All color parameter values are \c #UIColor objects except that systemHighlightColor is \c #RGBColor object. 319 | * 320 | * @param baseFontFamily The base font family of the application. 321 | * @param baseFontSize The base font size of the application. 322 | * @param appBarBackgroundColor The application bar background color. 323 | * @param panelBackgroundColor The background color of the extension panel. 324 | * @param appBarBackgroundColorSRGB The application bar background color, as sRGB. 325 | * @param panelBackgroundColorSRGB The background color of the extension panel, as sRGB. 326 | * @param systemHighlightColor The highlight color of the extension panel, if provided by the host application. Otherwise, the operating-system highlight color. 327 | * 328 | * @return AppSkinInfo object. 329 | */ 330 | function AppSkinInfo(baseFontFamily, baseFontSize, appBarBackgroundColor, panelBackgroundColor, appBarBackgroundColorSRGB, panelBackgroundColorSRGB, systemHighlightColor) 331 | { 332 | this.baseFontFamily = baseFontFamily; 333 | this.baseFontSize = baseFontSize; 334 | this.appBarBackgroundColor = appBarBackgroundColor; 335 | this.panelBackgroundColor = panelBackgroundColor; 336 | this.appBarBackgroundColorSRGB = appBarBackgroundColorSRGB; 337 | this.panelBackgroundColorSRGB = panelBackgroundColorSRGB; 338 | this.systemHighlightColor = systemHighlightColor; 339 | } 340 | 341 | /** 342 | * @class HostEnvironment 343 | * Stores information about the environment in which the extension is loaded. 344 | * 345 | * @param appName The application's name. 346 | * @param appVersion The application's version. 347 | * @param appLocale The application's current license locale. 348 | * @param appUILocale The application's current UI locale. 349 | * @param appId The application's unique identifier. 350 | * @param isAppOnline True if the application is currently online. 351 | * @param appSkinInfo An \c #AppSkinInfo object containing the application's default color and font styles. 352 | * 353 | * @return A new \c HostEnvironment object. 354 | */ 355 | function HostEnvironment(appName, appVersion, appLocale, appUILocale, appId, isAppOnline, appSkinInfo) 356 | { 357 | this.appName = appName; 358 | this.appVersion = appVersion; 359 | this.appLocale = appLocale; 360 | this.appUILocale = appUILocale; 361 | this.appId = appId; 362 | this.isAppOnline = isAppOnline; 363 | this.appSkinInfo = appSkinInfo; 364 | } 365 | 366 | /** 367 | * @class HostCapabilities 368 | * Stores information about the host capabilities. 369 | * 370 | * @param EXTENDED_PANEL_MENU True if the application supports panel menu. 371 | * @param EXTENDED_PANEL_ICONS True if the application supports panel icon. 372 | * @param DELEGATE_APE_ENGINE True if the application supports delegated APE engine. 373 | * @param SUPPORT_HTML_EXTENSIONS True if the application supports HTML extensions. 374 | * @param DISABLE_FLASH_EXTENSIONS True if the application disables FLASH extensions. 375 | * 376 | * @return A new \c HostCapabilities object. 377 | */ 378 | function HostCapabilities(EXTENDED_PANEL_MENU, EXTENDED_PANEL_ICONS, DELEGATE_APE_ENGINE, SUPPORT_HTML_EXTENSIONS, DISABLE_FLASH_EXTENSIONS) 379 | { 380 | this.EXTENDED_PANEL_MENU = EXTENDED_PANEL_MENU; 381 | this.EXTENDED_PANEL_ICONS = EXTENDED_PANEL_ICONS; 382 | this.DELEGATE_APE_ENGINE = DELEGATE_APE_ENGINE; 383 | this.SUPPORT_HTML_EXTENSIONS = SUPPORT_HTML_EXTENSIONS; 384 | this.DISABLE_FLASH_EXTENSIONS = DISABLE_FLASH_EXTENSIONS; // Since 5.0.0 385 | } 386 | 387 | /** 388 | * @class ApiVersion 389 | * Stores current api version. 390 | * 391 | * Since 4.2.0 392 | * 393 | * @param major The major version 394 | * @param minor The minor version. 395 | * @param micro The micro version. 396 | * 397 | * @return ApiVersion object. 398 | */ 399 | function ApiVersion(major, minor, micro) 400 | { 401 | this.major = major; 402 | this.minor = minor; 403 | this.micro = micro; 404 | } 405 | 406 | /** 407 | * @class MenuItemStatus 408 | * Stores flyout menu item status 409 | * 410 | * Since 5.2.0 411 | * 412 | * @param menuItemLabel The menu item label. 413 | * @param enabled True if user wants to enable the menu item. 414 | * @param checked True if user wants to check the menu item. 415 | * 416 | * @return MenuItemStatus object. 417 | */ 418 | function MenuItemStatus(menuItemLabel, enabled, checked) 419 | { 420 | this.menuItemLabel = menuItemLabel; 421 | this.enabled = enabled; 422 | this.checked = checked; 423 | } 424 | 425 | /** 426 | * @class ContextMenuItemStatus 427 | * Stores the status of the context menu item. 428 | * 429 | * Since 5.2.0 430 | * 431 | * @param menuItemID The menu item id. 432 | * @param enabled True if user wants to enable the menu item. 433 | * @param checked True if user wants to check the menu item. 434 | * 435 | * @return MenuItemStatus object. 436 | */ 437 | function ContextMenuItemStatus(menuItemID, enabled, checked) 438 | { 439 | this.menuItemID = menuItemID; 440 | this.enabled = enabled; 441 | this.checked = checked; 442 | } 443 | //------------------------------ CSInterface ---------------------------------- 444 | 445 | /** 446 | * @class CSInterface 447 | * This is the entry point to the CEP extensibility infrastructure. 448 | * Instantiate this object and use it to: 449 | *
    450 | *
  • Access information about the host application in which an extension is running
  • 451 | *
  • Launch an extension
  • 452 | *
  • Register interest in event notifications, and dispatch events
  • 453 | *
454 | * 455 | * @return A new \c CSInterface object 456 | */ 457 | function CSInterface() 458 | { 459 | } 460 | 461 | /** 462 | * User can add this event listener to handle native application theme color changes. 463 | * Callback function gives extensions ability to fine-tune their theme color after the 464 | * global theme color has been changed. 465 | * The callback function should be like below: 466 | * 467 | * @example 468 | * // event is a CSEvent object, but user can ignore it. 469 | * function OnAppThemeColorChanged(event) 470 | * { 471 | * // Should get a latest HostEnvironment object from application. 472 | * var skinInfo = JSON.parse(window.__adobe_cep__.getHostEnvironment()).appSkinInfo; 473 | * // Gets the style information such as color info from the skinInfo, 474 | * // and redraw all UI controls of your extension according to the style info. 475 | * } 476 | */ 477 | CSInterface.THEME_COLOR_CHANGED_EVENT = "com.adobe.csxs.events.ThemeColorChanged"; 478 | 479 | /** The host environment data object. */ 480 | CSInterface.prototype.hostEnvironment = window.__adobe_cep__ ? JSON.parse(window.__adobe_cep__.getHostEnvironment()) : null; 481 | 482 | /** Retrieves information about the host environment in which the 483 | * extension is currently running. 484 | * 485 | * @return A \c #HostEnvironment object. 486 | */ 487 | CSInterface.prototype.getHostEnvironment = function() 488 | { 489 | this.hostEnvironment = JSON.parse(window.__adobe_cep__.getHostEnvironment()); 490 | return this.hostEnvironment; 491 | }; 492 | 493 | /** Loads binary file created which is located at url asynchronously 494 | * 495 | *@param urlName url at which binary file is located. Local files should start with 'file://' 496 | *@param callback Optional. A callback function that returns after binary is loaded 497 | 498 | *@example 499 | * To create JS binary use command ./cep_compiler test.js test.bin 500 | * To load JS binary asyncronously 501 | * var CSLib = new CSInterface(); 502 | * CSLib.loadBinAsync(url, function () { }); 503 | */ 504 | CSInterface.prototype.loadBinAsync = function(urlName,callback) 505 | { 506 | try 507 | { 508 | var xhr = new XMLHttpRequest(); 509 | xhr.responseType = 'arraybuffer'; // make response as ArrayBuffer 510 | xhr.open('GET', urlName, true); 511 | xhr.onerror = function () 512 | { 513 | console.log("Unable to load snapshot from given URL"); 514 | return false; 515 | }; 516 | xhr.send(); 517 | xhr.onload = () => { 518 | window.__adobe_cep__.loadSnapshot(xhr.response); 519 | if (typeof callback === "function") 520 | { 521 | callback(); 522 | } 523 | else if(typeof callback !== "undefined") 524 | { 525 | console.log("Provided callback is not a function"); 526 | } 527 | } 528 | } 529 | catch(err) 530 | { 531 | console.log(err); 532 | return false; 533 | } 534 | 535 | return true; 536 | }; 537 | 538 | /** Loads binary file created synchronously 539 | * 540 | *@param pathName the local path at which binary file is located 541 | 542 | *@example 543 | * To create JS binary use command ./cep_compiler test.js test.bin 544 | * To load JS binary syncronously 545 | * var CSLib = new CSInterface(); 546 | * CSLib.loadBinSync(path); 547 | */ 548 | CSInterface.prototype.loadBinSync = function(pathName) 549 | { 550 | try 551 | { 552 | var OSVersion = this.getOSInformation(); 553 | if(pathName.startsWith("file://")) 554 | { 555 | if (OSVersion.indexOf("Windows") >= 0) 556 | { 557 | pathName = pathName.replace("file:///", ""); 558 | } 559 | else if (OSVersion.indexOf("Mac") >= 0) 560 | { 561 | pathName = pathName.replace("file://", ""); 562 | } 563 | window.__adobe_cep__.loadSnapshot(pathName); 564 | return true; 565 | } 566 | } 567 | catch(err) 568 | { 569 | console.log(err); 570 | return false; 571 | } 572 | //control should not come here 573 | return false; 574 | }; 575 | 576 | /** Closes this extension. */ 577 | CSInterface.prototype.closeExtension = function() 578 | { 579 | window.__adobe_cep__.closeExtension(); 580 | }; 581 | 582 | /** 583 | * Retrieves a path for which a constant is defined in the system. 584 | * 585 | * @param pathType The path-type constant defined in \c #SystemPath , 586 | * 587 | * @return The platform-specific system path string. 588 | */ 589 | CSInterface.prototype.getSystemPath = function(pathType) 590 | { 591 | var path = decodeURI(window.__adobe_cep__.getSystemPath(pathType)); 592 | var OSVersion = this.getOSInformation(); 593 | if (OSVersion.indexOf("Windows") >= 0) 594 | { 595 | path = path.replace("file:///", ""); 596 | } 597 | else if (OSVersion.indexOf("Mac") >= 0) 598 | { 599 | path = path.replace("file://", ""); 600 | } 601 | return path; 602 | }; 603 | 604 | /** 605 | * Evaluates a JavaScript script, which can use the JavaScript DOM 606 | * of the host application. 607 | * 608 | * @param script The JavaScript script. 609 | * @param callback Optional. A callback function that receives the result of execution. 610 | * If execution fails, the callback function receives the error message \c EvalScript_ErrMessage. 611 | */ 612 | CSInterface.prototype.evalScript = function(script, callback) 613 | { 614 | if(callback === null || callback === undefined) 615 | { 616 | callback = function(result){}; 617 | } 618 | window.__adobe_cep__.evalScript(script, callback); 619 | }; 620 | 621 | /** 622 | * Retrieves the unique identifier of the application. 623 | * in which the extension is currently running. 624 | * 625 | * @return The unique ID string. 626 | */ 627 | CSInterface.prototype.getApplicationID = function() 628 | { 629 | var appId = this.hostEnvironment.appId; 630 | return appId; 631 | }; 632 | 633 | /** 634 | * Retrieves host capability information for the application 635 | * in which the extension is currently running. 636 | * 637 | * @return A \c #HostCapabilities object. 638 | */ 639 | CSInterface.prototype.getHostCapabilities = function() 640 | { 641 | var hostCapabilities = JSON.parse(window.__adobe_cep__.getHostCapabilities() ); 642 | return hostCapabilities; 643 | }; 644 | 645 | /** 646 | * Triggers a CEP event programmatically. Yoy can use it to dispatch 647 | * an event of a predefined type, or of a type you have defined. 648 | * 649 | * @param event A \c CSEvent object. 650 | */ 651 | CSInterface.prototype.dispatchEvent = function(event) 652 | { 653 | if (typeof event.data == "object") 654 | { 655 | event.data = JSON.stringify(event.data); 656 | } 657 | 658 | window.__adobe_cep__.dispatchEvent(event); 659 | }; 660 | 661 | /** 662 | * Registers an interest in a CEP event of a particular type, and 663 | * assigns an event handler. 664 | * The event infrastructure notifies your extension when events of this type occur, 665 | * passing the event object to the registered handler function. 666 | * 667 | * @param type The name of the event type of interest. 668 | * @param listener The JavaScript handler function or method. 669 | * @param obj Optional, the object containing the handler method, if any. 670 | * Default is null. 671 | */ 672 | CSInterface.prototype.addEventListener = function(type, listener, obj) 673 | { 674 | window.__adobe_cep__.addEventListener(type, listener, obj); 675 | }; 676 | 677 | /** 678 | * Removes a registered event listener. 679 | * 680 | * @param type The name of the event type of interest. 681 | * @param listener The JavaScript handler function or method that was registered. 682 | * @param obj Optional, the object containing the handler method, if any. 683 | * Default is null. 684 | */ 685 | CSInterface.prototype.removeEventListener = function(type, listener, obj) 686 | { 687 | window.__adobe_cep__.removeEventListener(type, listener, obj); 688 | }; 689 | 690 | /** 691 | * Loads and launches another extension, or activates the extension if it is already loaded. 692 | * 693 | * @param extensionId The extension's unique identifier. 694 | * @param startupParams Not currently used, pass "". 695 | * 696 | * @example 697 | * To launch the extension "help" with ID "HLP" from this extension, call: 698 | * requestOpenExtension("HLP", ""); 699 | * 700 | */ 701 | CSInterface.prototype.requestOpenExtension = function(extensionId, params) 702 | { 703 | window.__adobe_cep__.requestOpenExtension(extensionId, params); 704 | }; 705 | 706 | /** 707 | * Retrieves the list of extensions currently loaded in the current host application. 708 | * The extension list is initialized once, and remains the same during the lifetime 709 | * of the CEP session. 710 | * 711 | * @param extensionIds Optional, an array of unique identifiers for extensions of interest. 712 | * If omitted, retrieves data for all extensions. 713 | * 714 | * @return Zero or more \c #Extension objects. 715 | */ 716 | CSInterface.prototype.getExtensions = function(extensionIds) 717 | { 718 | var extensionIdsStr = JSON.stringify(extensionIds); 719 | var extensionsStr = window.__adobe_cep__.getExtensions(extensionIdsStr); 720 | 721 | var extensions = JSON.parse(extensionsStr); 722 | return extensions; 723 | }; 724 | 725 | /** 726 | * Retrieves network-related preferences. 727 | * 728 | * @return A JavaScript object containing network preferences. 729 | */ 730 | CSInterface.prototype.getNetworkPreferences = function() 731 | { 732 | var result = window.__adobe_cep__.getNetworkPreferences(); 733 | var networkPre = JSON.parse(result); 734 | 735 | return networkPre; 736 | }; 737 | 738 | /** 739 | * Initializes the resource bundle for this extension with property values 740 | * for the current application and locale. 741 | * To support multiple locales, you must define a property file for each locale, 742 | * containing keyed display-string values for that locale. 743 | * See localization documentation for Extension Builder and related products. 744 | * 745 | * Keys can be in the 746 | * form key.value="localized string", for use in HTML text elements. 747 | * For example, in this input element, the localized \c key.value string is displayed 748 | * instead of the empty \c value string: 749 | * 750 | * 751 | * 752 | * @return An object containing the resource bundle information. 753 | */ 754 | CSInterface.prototype.initResourceBundle = function() 755 | { 756 | var resourceBundle = JSON.parse(window.__adobe_cep__.initResourceBundle()); 757 | var resElms = document.querySelectorAll('[data-locale]'); 758 | for (var n = 0; n < resElms.length; n++) 759 | { 760 | var resEl = resElms[n]; 761 | // Get the resource key from the element. 762 | var resKey = resEl.getAttribute('data-locale'); 763 | if (resKey) 764 | { 765 | // Get all the resources that start with the key. 766 | for (var key in resourceBundle) 767 | { 768 | if (key.indexOf(resKey) === 0) 769 | { 770 | var resValue = resourceBundle[key]; 771 | if (key.length == resKey.length) 772 | { 773 | resEl.innerHTML = resValue; 774 | } 775 | else if ('.' == key.charAt(resKey.length)) 776 | { 777 | var attrKey = key.substring(resKey.length + 1); 778 | resEl[attrKey] = resValue; 779 | } 780 | } 781 | } 782 | } 783 | } 784 | return resourceBundle; 785 | }; 786 | 787 | /** 788 | * Writes installation information to a file. 789 | * 790 | * @return The file path. 791 | */ 792 | CSInterface.prototype.dumpInstallationInfo = function() 793 | { 794 | return window.__adobe_cep__.dumpInstallationInfo(); 795 | }; 796 | 797 | /** 798 | * Retrieves version information for the current Operating System, 799 | * See http://www.useragentstring.com/pages/Chrome/ for Chrome \c navigator.userAgent values. 800 | * 801 | * @return A string containing the OS version, or "unknown Operation System". 802 | * If user customizes the User Agent by setting CEF command parameter "--user-agent", only 803 | * "Mac OS X" or "Windows" will be returned. 804 | */ 805 | CSInterface.prototype.getOSInformation = function() 806 | { 807 | var userAgent = navigator.userAgent; 808 | 809 | if ((navigator.platform == "Win32") || (navigator.platform == "Windows")) 810 | { 811 | var winVersion = "Windows"; 812 | var winBit = ""; 813 | if (userAgent.indexOf("Windows") > -1) 814 | { 815 | if (userAgent.indexOf("Windows NT 5.0") > -1) 816 | { 817 | winVersion = "Windows 2000"; 818 | } 819 | else if (userAgent.indexOf("Windows NT 5.1") > -1) 820 | { 821 | winVersion = "Windows XP"; 822 | } 823 | else if (userAgent.indexOf("Windows NT 5.2") > -1) 824 | { 825 | winVersion = "Windows Server 2003"; 826 | } 827 | else if (userAgent.indexOf("Windows NT 6.0") > -1) 828 | { 829 | winVersion = "Windows Vista"; 830 | } 831 | else if (userAgent.indexOf("Windows NT 6.1") > -1) 832 | { 833 | winVersion = "Windows 7"; 834 | } 835 | else if (userAgent.indexOf("Windows NT 6.2") > -1) 836 | { 837 | winVersion = "Windows 8"; 838 | } 839 | else if (userAgent.indexOf("Windows NT 6.3") > -1) 840 | { 841 | winVersion = "Windows 8.1"; 842 | } 843 | else if (userAgent.indexOf("Windows NT 10") > -1) 844 | { 845 | winVersion = "Windows 10"; 846 | } 847 | 848 | if (userAgent.indexOf("WOW64") > -1 || userAgent.indexOf("Win64") > -1) 849 | { 850 | winBit = " 64-bit"; 851 | } 852 | else 853 | { 854 | winBit = " 32-bit"; 855 | } 856 | } 857 | 858 | return winVersion + winBit; 859 | } 860 | else if ((navigator.platform == "MacIntel") || (navigator.platform == "Macintosh")) 861 | { 862 | var result = "Mac OS X"; 863 | 864 | if (userAgent.indexOf("Mac OS X") > -1) 865 | { 866 | result = userAgent.substring(userAgent.indexOf("Mac OS X"), userAgent.indexOf(")")); 867 | result = result.replace(/_/g, "."); 868 | } 869 | 870 | return result; 871 | } 872 | 873 | return "Unknown Operation System"; 874 | }; 875 | 876 | /** 877 | * Opens a page in the default system browser. 878 | * 879 | * Since 4.2.0 880 | * 881 | * @param url The URL of the page/file to open, or the email address. 882 | * Must use HTTP/HTTPS/file/mailto protocol. For example: 883 | * "http://www.adobe.com" 884 | * "https://github.com" 885 | * "file:///C:/log.txt" 886 | * "mailto:test@adobe.com" 887 | * 888 | * @return One of these error codes:\n 889 | *
    \n 890 | *
  • NO_ERROR - 0
  • \n 891 | *
  • ERR_UNKNOWN - 1
  • \n 892 | *
  • ERR_INVALID_PARAMS - 2
  • \n 893 | *
  • ERR_INVALID_URL - 201
  • \n 894 | *
\n 895 | */ 896 | CSInterface.prototype.openURLInDefaultBrowser = function(url) 897 | { 898 | return cep.util.openURLInDefaultBrowser(url); 899 | }; 900 | 901 | /** 902 | * Retrieves extension ID. 903 | * 904 | * Since 4.2.0 905 | * 906 | * @return extension ID. 907 | */ 908 | CSInterface.prototype.getExtensionID = function() 909 | { 910 | return window.__adobe_cep__.getExtensionId(); 911 | }; 912 | 913 | /** 914 | * Retrieves the scale factor of screen. 915 | * On Windows platform, the value of scale factor might be different from operating system's scale factor, 916 | * since host application may use its self-defined scale factor. 917 | * 918 | * Since 4.2.0 919 | * 920 | * @return One of the following float number. 921 | *
    \n 922 | *
  • -1.0 when error occurs
  • \n 923 | *
  • 1.0 means normal screen
  • \n 924 | *
  • >1.0 means HiDPI screen
  • \n 925 | *
\n 926 | */ 927 | CSInterface.prototype.getScaleFactor = function() 928 | { 929 | return window.__adobe_cep__.getScaleFactor(); 930 | }; 931 | 932 | /** 933 | * Retrieves the scale factor of Monitor. 934 | * 935 | * Since 8.5.0 936 | * 937 | * @return value >= 1.0f 938 | * only available for windows machine 939 | */ 940 | if(navigator.appVersion.toLowerCase().indexOf("windows") >= 0) { 941 | CSInterface.prototype.getMonitorScaleFactor = function() 942 | { 943 | return window.__adobe_cep__.getMonitorScaleFactor(); 944 | }; 945 | } 946 | 947 | /** 948 | * Set a handler to detect any changes of scale factor. This only works on Mac. 949 | * 950 | * Since 4.2.0 951 | * 952 | * @param handler The function to be called when scale factor is changed. 953 | * 954 | */ 955 | CSInterface.prototype.setScaleFactorChangedHandler = function(handler) 956 | { 957 | window.__adobe_cep__.setScaleFactorChangedHandler(handler); 958 | }; 959 | 960 | /** 961 | * Retrieves current API version. 962 | * 963 | * Since 4.2.0 964 | * 965 | * @return ApiVersion object. 966 | * 967 | */ 968 | CSInterface.prototype.getCurrentApiVersion = function() 969 | { 970 | var apiVersion = JSON.parse(window.__adobe_cep__.getCurrentApiVersion()); 971 | return apiVersion; 972 | }; 973 | 974 | /** 975 | * Set panel flyout menu by an XML. 976 | * 977 | * Since 5.2.0 978 | * 979 | * Register a callback function for "com.adobe.csxs.events.flyoutMenuClicked" to get notified when a 980 | * menu item is clicked. 981 | * The "data" attribute of event is an object which contains "menuId" and "menuName" attributes. 982 | * 983 | * Register callback functions for "com.adobe.csxs.events.flyoutMenuOpened" and "com.adobe.csxs.events.flyoutMenuClosed" 984 | * respectively to get notified when flyout menu is opened or closed. 985 | * 986 | * @param menu A XML string which describes menu structure. 987 | * An example menu XML: 988 | * 989 | * 990 | * 991 | * 992 | * 993 | * 994 | * 995 | * 996 | * 997 | * 998 | * 999 | * 1000 | */ 1001 | CSInterface.prototype.setPanelFlyoutMenu = function(menu) 1002 | { 1003 | if ("string" != typeof menu) 1004 | { 1005 | return; 1006 | } 1007 | 1008 | window.__adobe_cep__.invokeSync("setPanelFlyoutMenu", menu); 1009 | }; 1010 | 1011 | /** 1012 | * Updates a menu item in the extension window's flyout menu, by setting the enabled 1013 | * and selection status. 1014 | * 1015 | * Since 5.2.0 1016 | * 1017 | * @param menuItemLabel The menu item label. 1018 | * @param enabled True to enable the item, false to disable it (gray it out). 1019 | * @param checked True to select the item, false to deselect it. 1020 | * 1021 | * @return false when the host application does not support this functionality (HostCapabilities.EXTENDED_PANEL_MENU is false). 1022 | * Fails silently if menu label is invalid. 1023 | * 1024 | * @see HostCapabilities.EXTENDED_PANEL_MENU 1025 | */ 1026 | CSInterface.prototype.updatePanelMenuItem = function(menuItemLabel, enabled, checked) 1027 | { 1028 | var ret = false; 1029 | if (this.getHostCapabilities().EXTENDED_PANEL_MENU) 1030 | { 1031 | var itemStatus = new MenuItemStatus(menuItemLabel, enabled, checked); 1032 | ret = window.__adobe_cep__.invokeSync("updatePanelMenuItem", JSON.stringify(itemStatus)); 1033 | } 1034 | return ret; 1035 | }; 1036 | 1037 | 1038 | /** 1039 | * Set context menu by XML string. 1040 | * 1041 | * Since 5.2.0 1042 | * 1043 | * There are a number of conventions used to communicate what type of menu item to create and how it should be handled. 1044 | * - an item without menu ID or menu name is disabled and is not shown. 1045 | * - if the item name is "---" (three hyphens) then it is treated as a separator. The menu ID in this case will always be NULL. 1046 | * - Checkable attribute takes precedence over Checked attribute. 1047 | * - a PNG icon. For optimal display results please supply a 16 x 16px icon as larger dimensions will increase the size of the menu item. 1048 | The Chrome extension contextMenus API was taken as a reference. 1049 | https://developer.chrome.com/extensions/contextMenus 1050 | * - the items with icons and checkable items cannot coexist on the same menu level. The former take precedences over the latter. 1051 | * 1052 | * @param menu A XML string which describes menu structure. 1053 | * @param callback The callback function which is called when a menu item is clicked. The only parameter is the returned ID of clicked menu item. 1054 | * 1055 | * @description An example menu XML: 1056 | * 1057 | * 1058 | * 1059 | * 1060 | * 1061 | * 1062 | * 1063 | * 1064 | * 1065 | * 1066 | * 1067 | */ 1068 | CSInterface.prototype.setContextMenu = function(menu, callback) 1069 | { 1070 | if ("string" != typeof menu) 1071 | { 1072 | return; 1073 | } 1074 | 1075 | window.__adobe_cep__.invokeAsync("setContextMenu", menu, callback); 1076 | }; 1077 | 1078 | /** 1079 | * Set context menu by JSON string. 1080 | * 1081 | * Since 6.0.0 1082 | * 1083 | * There are a number of conventions used to communicate what type of menu item to create and how it should be handled. 1084 | * - an item without menu ID or menu name is disabled and is not shown. 1085 | * - if the item label is "---" (three hyphens) then it is treated as a separator. The menu ID in this case will always be NULL. 1086 | * - Checkable attribute takes precedence over Checked attribute. 1087 | * - a PNG icon. For optimal display results please supply a 16 x 16px icon as larger dimensions will increase the size of the menu item. 1088 | The Chrome extension contextMenus API was taken as a reference. 1089 | * - the items with icons and checkable items cannot coexist on the same menu level. The former take precedences over the latter. 1090 | https://developer.chrome.com/extensions/contextMenus 1091 | * 1092 | * @param menu A JSON string which describes menu structure. 1093 | * @param callback The callback function which is called when a menu item is clicked. The only parameter is the returned ID of clicked menu item. 1094 | * 1095 | * @description An example menu JSON: 1096 | * 1097 | * { 1098 | * "menu": [ 1099 | * { 1100 | * "id": "menuItemId1", 1101 | * "label": "testExample1", 1102 | * "enabled": true, 1103 | * "checkable": true, 1104 | * "checked": false, 1105 | * "icon": "./image/small_16X16.png" 1106 | * }, 1107 | * { 1108 | * "id": "menuItemId2", 1109 | * "label": "testExample2", 1110 | * "menu": [ 1111 | * { 1112 | * "id": "menuItemId2-1", 1113 | * "label": "testExample2-1", 1114 | * "menu": [ 1115 | * { 1116 | * "id": "menuItemId2-1-1", 1117 | * "label": "testExample2-1-1", 1118 | * "enabled": false, 1119 | * "checkable": true, 1120 | * "checked": true 1121 | * } 1122 | * ] 1123 | * }, 1124 | * { 1125 | * "id": "menuItemId2-2", 1126 | * "label": "testExample2-2", 1127 | * "enabled": true, 1128 | * "checkable": true, 1129 | * "checked": true 1130 | * } 1131 | * ] 1132 | * }, 1133 | * { 1134 | * "label": "---" 1135 | * }, 1136 | * { 1137 | * "id": "menuItemId3", 1138 | * "label": "testExample3", 1139 | * "enabled": false, 1140 | * "checkable": true, 1141 | * "checked": false 1142 | * } 1143 | * ] 1144 | * } 1145 | * 1146 | */ 1147 | CSInterface.prototype.setContextMenuByJSON = function(menu, callback) 1148 | { 1149 | if ("string" != typeof menu) 1150 | { 1151 | return; 1152 | } 1153 | 1154 | window.__adobe_cep__.invokeAsync("setContextMenuByJSON", menu, callback); 1155 | }; 1156 | 1157 | /** 1158 | * Updates a context menu item by setting the enabled and selection status. 1159 | * 1160 | * Since 5.2.0 1161 | * 1162 | * @param menuItemID The menu item ID. 1163 | * @param enabled True to enable the item, false to disable it (gray it out). 1164 | * @param checked True to select the item, false to deselect it. 1165 | */ 1166 | CSInterface.prototype.updateContextMenuItem = function(menuItemID, enabled, checked) 1167 | { 1168 | var itemStatus = new ContextMenuItemStatus(menuItemID, enabled, checked); 1169 | ret = window.__adobe_cep__.invokeSync("updateContextMenuItem", JSON.stringify(itemStatus)); 1170 | }; 1171 | 1172 | /** 1173 | * Get the visibility status of an extension window. 1174 | * 1175 | * Since 6.0.0 1176 | * 1177 | * @return true if the extension window is visible; false if the extension window is hidden. 1178 | */ 1179 | CSInterface.prototype.isWindowVisible = function() 1180 | { 1181 | return window.__adobe_cep__.invokeSync("isWindowVisible", ""); 1182 | }; 1183 | 1184 | /** 1185 | * Resize extension's content to the specified dimensions. 1186 | * 1. Works with modal and modeless extensions in all Adobe products. 1187 | * 2. Extension's manifest min/max size constraints apply and take precedence. 1188 | * 3. For panel extensions 1189 | * 3.1 This works in all Adobe products except: 1190 | * * Premiere Pro 1191 | * * Prelude 1192 | * * After Effects 1193 | * 3.2 When the panel is in certain states (especially when being docked), 1194 | * it will not change to the desired dimensions even when the 1195 | * specified size satisfies min/max constraints. 1196 | * 1197 | * Since 6.0.0 1198 | * 1199 | * @param width The new width 1200 | * @param height The new height 1201 | */ 1202 | CSInterface.prototype.resizeContent = function(width, height) 1203 | { 1204 | window.__adobe_cep__.resizeContent(width, height); 1205 | }; 1206 | 1207 | /** 1208 | * Register the invalid certificate callback for an extension. 1209 | * This callback will be triggered when the extension tries to access the web site that contains the invalid certificate on the main frame. 1210 | * But if the extension does not call this function and tries to access the web site containing the invalid certificate, a default error page will be shown. 1211 | * 1212 | * Since 6.1.0 1213 | * 1214 | * @param callback the callback function 1215 | */ 1216 | CSInterface.prototype.registerInvalidCertificateCallback = function(callback) 1217 | { 1218 | return window.__adobe_cep__.registerInvalidCertificateCallback(callback); 1219 | }; 1220 | 1221 | /** 1222 | * Register an interest in some key events to prevent them from being sent to the host application. 1223 | * 1224 | * This function works with modeless extensions and panel extensions. 1225 | * Generally all the key events will be sent to the host application for these two extensions if the current focused element 1226 | * is not text input or dropdown, 1227 | * If you want to intercept some key events and want them to be handled in the extension, please call this function 1228 | * in advance to prevent them being sent to the host application. 1229 | * 1230 | * Since 6.1.0 1231 | * 1232 | * @param keyEventsInterest A JSON string describing those key events you are interested in. A null object or 1233 | an empty string will lead to removing the interest 1234 | * 1235 | * This JSON string should be an array, each object has following keys: 1236 | * 1237 | * keyCode: [Required] represents an OS system dependent virtual key code identifying 1238 | * the unmodified value of the pressed key. 1239 | * ctrlKey: [optional] a Boolean that indicates if the control key was pressed (true) or not (false) when the event occurred. 1240 | * altKey: [optional] a Boolean that indicates if the alt key was pressed (true) or not (false) when the event occurred. 1241 | * shiftKey: [optional] a Boolean that indicates if the shift key was pressed (true) or not (false) when the event occurred. 1242 | * metaKey: [optional] (Mac Only) a Boolean that indicates if the Meta key was pressed (true) or not (false) when the event occurred. 1243 | * On Macintosh keyboards, this is the command key. To detect Windows key on Windows, please use keyCode instead. 1244 | * An example JSON string: 1245 | * 1246 | * [ 1247 | * { 1248 | * "keyCode": 48 1249 | * }, 1250 | * { 1251 | * "keyCode": 123, 1252 | * "ctrlKey": true 1253 | * }, 1254 | * { 1255 | * "keyCode": 123, 1256 | * "ctrlKey": true, 1257 | * "metaKey": true 1258 | * } 1259 | * ] 1260 | * 1261 | */ 1262 | CSInterface.prototype.registerKeyEventsInterest = function(keyEventsInterest) 1263 | { 1264 | return window.__adobe_cep__.registerKeyEventsInterest(keyEventsInterest); 1265 | }; 1266 | 1267 | /** 1268 | * Set the title of the extension window. 1269 | * This function works with modal and modeless extensions in all Adobe products, and panel extensions in Photoshop, InDesign, InCopy, Illustrator, Flash Pro and Dreamweaver. 1270 | * 1271 | * Since 6.1.0 1272 | * 1273 | * @param title The window title. 1274 | */ 1275 | CSInterface.prototype.setWindowTitle = function(title) 1276 | { 1277 | window.__adobe_cep__.invokeSync("setWindowTitle", title); 1278 | }; 1279 | 1280 | /** 1281 | * Get the title of the extension window. 1282 | * This function works with modal and modeless extensions in all Adobe products, and panel extensions in Photoshop, InDesign, InCopy, Illustrator, Flash Pro and Dreamweaver. 1283 | * 1284 | * Since 6.1.0 1285 | * 1286 | * @return The window title. 1287 | */ 1288 | CSInterface.prototype.getWindowTitle = function() 1289 | { 1290 | return window.__adobe_cep__.invokeSync("getWindowTitle", ""); 1291 | }; 1292 | -------------------------------------------------------------------------------- /typings/PremierePro.23.0.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * TypeScript definitions for Premiere Pro's ExtendScript API would not have happened 3 | * without the efforts of Eric Robinson and Pravdomil Toman. If you find these definitions 4 | * useful, it's thanks to them. If you find problems with them, they're mine. 5 | * 6 | * -bbb 7 | * 4/15/19 8 | * 9 | */ 10 | 11 | /** 12 | * 0 = false, 13 | * 1 = true 14 | */ 15 | 16 | type NumericalBool = 0 | 1; 17 | type MediaType = "Video" | "Audio" | "any"; 18 | type SampleRateOption = 48000 | 96000; 19 | type BitsPerSampleOption = 16 | 24; 20 | type SDKEventType = "warning" | "info" | "error"; 21 | 22 | interface $ 23 | { 24 | _PPP_: any; 25 | } 26 | /** 27 | * 28 | */ 29 | declare class ProjectItemType { 30 | /** 31 | * 32 | */ 33 | static readonly BIN: number 34 | 35 | /** 36 | * 37 | */ 38 | static readonly CLIP: number 39 | 40 | /** 41 | * 42 | */ 43 | static readonly FILE: number 44 | 45 | /** 46 | * 47 | */ 48 | static readonly ROOT: number 49 | 50 | /** 51 | * 52 | */ 53 | bind(eventName: string, function_: any): void 54 | 55 | /** 56 | * 57 | */ 58 | setTimeout(eventName: string, function_: any, milliseconds: number): void 59 | 60 | /** 61 | * 62 | */ 63 | unbind(eventName: string): void 64 | } 65 | 66 | /** 67 | * Structure containing sequence settings. 68 | */ 69 | declare class SequenceSettings { 70 | audioChannelCount: number 71 | audioChannelType: number 72 | audioDisplayFormat: number 73 | audioSampleRate: Time 74 | compositeLinearColor: boolean 75 | editingMode: String 76 | maximumBitDepth: boolean 77 | maximumRenderQuality: boolean 78 | previewCode: String 79 | previewFileFormat: String 80 | previewFrameHeight: number 81 | previewFrameWidth: number 82 | videoDisplayFormat: number 83 | videoFieldType: number 84 | videoFrameRate: Time 85 | videoFrameHeight: number 86 | videoFrameWidth: number 87 | videoPixelAspectRatio: number 88 | vrHorzCapturedView: number 89 | vrLayout: number 90 | vrProjection: number 91 | vrVertCapturedView: number 92 | workingColorSpaceList: Array 93 | workingColorSpace: colorSpace 94 | } 95 | 96 | /** 97 | * Structure describing audio channel mapping for a projectItem. 98 | */ 99 | declare class AudioChannelMapping { 100 | audioClipsNumber: number 101 | audioChannelsType: number 102 | setMappingForChannel(number:channelIndex, number:sourceChannelIndex): function 103 | } 104 | 105 | declare class colorSpace { 106 | /** 107 | * 108 | */ 109 | name: String 110 | 111 | /** 112 | * 113 | */ 114 | transferCharacteristic: String 115 | 116 | /** 117 | * 118 | */ 119 | matrixEquation: String 120 | 121 | /** 122 | * 123 | */ 124 | primaries: String 125 | 126 | /** 127 | * 128 | */ 129 | 130 | 131 | } 132 | 133 | /** 134 | * A sequence. 135 | */ 136 | declare class Sequence { 137 | 138 | /** 139 | * 140 | */ 141 | sequenceSettings: SequenceSettings 142 | 143 | /** 144 | * A collection of the sequence's audio tracks. 145 | */ 146 | readonly audioTracks: TrackCollection 147 | 148 | /** 149 | * Timecode (as a string) of the end of the sequence. 150 | */ 151 | readonly end: string 152 | 153 | /** 154 | * Width 155 | */ 156 | readonly frameSizeHorizontal: number 157 | 158 | /** 159 | * Height 160 | */ 161 | readonly frameSizeVertical: number 162 | 163 | /** 164 | * Sequence ID 165 | */ 166 | readonly id: number 167 | 168 | /** 169 | * The sequence's markers. 170 | */ 171 | readonly markers: MarkerCollection 172 | 173 | /** 174 | * The available colorspaces 175 | */ 176 | readonly workingColorSpaceList: Array 177 | 178 | /** 179 | * The color space in use by the sequence 180 | */ 181 | workingColorSpace: colorSpace 182 | 183 | /** 184 | * Name (writable). 185 | */ 186 | name: string 187 | 188 | /** 189 | * 190 | */ 191 | videoDisplayFormat: number 192 | 193 | /** 194 | * The `projectItem` corresponding to the sequence. 195 | */ 196 | readonly projectItem: ProjectItem 197 | 198 | /** 199 | * Permanent ID of the sequence, within its project. 200 | */ 201 | readonly sequenceID: string 202 | 203 | /** 204 | * 205 | */ 206 | readonly timebase: string 207 | 208 | /** 209 | * 210 | */ 211 | readonly videoTracks: TrackCollection 212 | 213 | /** 214 | * The starting timecode of the first frame of the sequence, as a string. 215 | */ 216 | readonly zeroPoint: string 217 | 218 | /** 219 | * Adds a new metadata key to the sequence, and sets its value. 220 | * @param propertyID Name of new property 221 | * @param propertyValue Value of new property 222 | */ 223 | attachCustomProperty(propertyID: string, propertyValue: string): void 224 | 225 | /** 226 | * 227 | */ 228 | bind(eventName: string, function_: any): void 229 | 230 | /** 231 | * Clones a sequence. 232 | * @returns the clone Sequence. 233 | */ 234 | clone(): Sequence 235 | 236 | /** 237 | * Creates a new sequence from the source sequence's in and out points. 238 | * @param ignoreMapping If True the current selection, not track targeting, will determine 239 | * the clips to include in the new sequence. 240 | * 241 | * If there is no selection, track targeting determines which clips are included in the new sequence. 242 | */ 243 | createSubsequence(ignoreMapping:Boolean): Sequence 244 | 245 | /** 246 | * Exports a new FCP XML file representing this sequence. 247 | * @param exportPath The full file path (with file name) to create. 248 | * @param suppressUI Optional; quiets any warnings or errors encountered during export. 249 | */ 250 | exportAsFinalCutProXML(exportPath: string, suppressUI?: number): boolean 251 | 252 | /** 253 | * Premiere Pro exports the sequence immediately. 254 | * @param outputFilePath The output file path (with name). 255 | * @param presetPath The .epr file to use. 256 | * @param workAreaType Optional work area specifier. 257 | */ 258 | exportAsMediaDirect(outputFilePath: string, presetPath: string, workAreaType?: number): string 259 | 260 | /** 261 | * Exports the sequence (and its constituent media) as a new PPro project. 262 | * @param path Output file path, including file name. 263 | */ 264 | exportAsProject(exportPath: string): void 265 | 266 | /** 267 | * Retrieves the file extension associated with a given output preset (.epr file). 268 | * @param presetFilePath full path to .epr file 269 | */ 270 | getExportFileExtension(presetFilePath: string): string 271 | 272 | /** 273 | * Retrieves the sequence's in point, as a timecode string. 274 | */ 275 | getInPoint(): string 276 | 277 | /** 278 | * Retrieves the sequence's out point, as a timecode string. 279 | */ 280 | getOutPoint(): string 281 | 282 | /** 283 | * Retrieves the sequence's in point, as a `Time` object. 284 | */ 285 | getInPointAsTime(): Time 286 | 287 | /** 288 | * Retrieves the sequence's out point, as a `Time` object. 289 | */ 290 | getOutPointAsTime(): Time 291 | 292 | 293 | /** 294 | * Retrieves the current player position, as a `Time` object. 295 | */ 296 | getPlayerPosition(): Time 297 | 298 | /** 299 | * Sets the in point of the sequence. 300 | * @param seconds Time of in point. 301 | */ 302 | setInPoint(seconds: number): void 303 | 304 | /** 305 | * Sets the out point of the sequence. 306 | * @param seconds Time of out point. 307 | */ 308 | setOutPoint(seconds: number): void 309 | 310 | /** 311 | * Sets the current player position. 312 | * @param pos The new position, as a string, representing ticks. 313 | */ 314 | setPlayerPosition(pos: string): void 315 | 316 | /** 317 | * 318 | */ 319 | setTimeout(eventName: string, function_: any, milliseconds: number): void 320 | 321 | /** 322 | * Sets the timecode of the first frame of the sequence. 323 | * @param newStartTime The new starting time, in `ticks`. 324 | */ 325 | setZeroPoint(newStartTime: string): void 326 | 327 | /** 328 | * Links the currently-selected `trackItems` together, if possible. 329 | * @returns `True` if successful. 330 | */ 331 | linkSelection(): boolean 332 | 333 | /** 334 | * Unlinks the currently-selected `trackItems`, if possible. 335 | * @returns `True` if successful. 336 | */ 337 | unlinkSelection(): boolean 338 | 339 | /** 340 | * Imports a Motion Graphics Template (.mogrt) into the sequence 341 | * @param pathToMOGRT Complete path to .mogrt 342 | * @param timeInTicks Time (in ticks) at which to insert 343 | * @param videoTrackOffset The offset from first video track to targeted track 344 | * @param audioTrackOffset The offset from first audio track to targeted track 345 | * @returns newly-created `trackItem` representing the .mogrt 346 | */ 347 | importMGT(pathToMOGRT:String, timeInTicks:String, videoTrackOffset:number, audioTrackOffset:number): TrackItem 348 | 349 | /** 350 | * Returns `true` if work area is enabled. 351 | */ 352 | isWorkAreaEnabled(): Boolean 353 | 354 | /** 355 | * Sets the enabled state of the seqeuence work area. 356 | * @param enableState The desired state 357 | */ 358 | setWorkAreaEnabled(enableState:Boolean): void 359 | 360 | /** 361 | * Returns the work area in point, in seconds. 362 | */ 363 | getWorkAreaInPoint(): number 364 | 365 | /** 366 | * Specify the work area in point, in seconds. 367 | * @param timeInSeconds new in point time. 368 | */ 369 | setWorkAreaInPoint(timeInSeconds:number): void 370 | 371 | /** 372 | * Returns the work area out point, in seconds. 373 | */ 374 | getWorkAreaOutPoint(): number 375 | 376 | /** 377 | * Specify the work area out point, in seconds. 378 | * @param timeInSeconds new out point time. 379 | */ 380 | setWorkAreaOutPoint(timeInSeconds:number): void 381 | 382 | /** 383 | * @returns the work area in point, as a `Time` object. 384 | */ 385 | getWorkAreaInPointAsTime(): Time 386 | 387 | /** 388 | * Specify the work area in point, as `Time`. 389 | */ 390 | setWorkAreaInPointAsTime(outPoint:Time): void 391 | 392 | /** 393 | * @returns the work area out point, as a `Time` object. 394 | */ 395 | getWorkAreaOutPointAsTime(): Time 396 | 397 | /** 398 | * Specify the work area out point, as `Time`. 399 | */ 400 | setWorkAreaOutPointAsTime(outPoint:Time): void 401 | 402 | /** 403 | * Inserts a clip (`trackItem`) into the sequence. 404 | * @param projectItem The project item to insert. 405 | * @param time Time at which to insert. 406 | * @param vidTrackOffset The offset from the first video track to targeted track 407 | * @param audTrackOffset The offset from the first audio track to targeted track 408 | */ 409 | insertClip(projectItem:ProjectItem, time:Time, vidTrackOffset:number, audTrackOffset:number): TrackItem 410 | 411 | /** 412 | * @returns currently-selected clips, as an `Array` of `trackItems` 413 | */ 414 | getSelection(): Array 415 | 416 | /** 417 | * Returns the current sequence settings. 418 | * @returns SequenceSettings 419 | */ 420 | getSettings(): SequenceSettings 421 | 422 | /** 423 | * Specifies the sequence settings to use. 424 | * @param newSettings New settings 425 | */ 426 | setSettings(newSettings): void 427 | 428 | /** 429 | * @returns true if effect analysis is complete 430 | */ 431 | 432 | isDoneAnalyzingForVideoEffects(): Boolean 433 | 434 | 435 | /** 436 | * 437 | * @param numerator Numerator of desired frame aspect ratio 438 | * @param denominator Denominator of desired frame aspect ratio 439 | * @param motionPreset Either "default", "faster" or "slower" 440 | * @param sequenceName Name for created sequence 441 | * @param nest Use nested sequences? 442 | */ 443 | 444 | 445 | autoReframeSequence(numerator:Number, denominator:Number, motionPreset:String, sequenceName:String, nest:Boolean): Sequence 446 | 447 | /** 448 | * 449 | * @param action Either 'ApplyCuts' or 'CreateMarkers' 450 | * @param applyCutsToLinkedAudio Operate on linked audio too? 451 | * @param sensitivity 'LowSensitivity', 'MediumSensitivity', or 'HighSensitivity' 452 | */ 453 | performCutDetectionOnSelection(action:String, applyCutsToLinkedAudio:Boolean, sensitivity:String) 454 | /** 455 | * 456 | */ 457 | unbind(eventName: string): void 458 | } 459 | 460 | 461 | /** 462 | * Structure containing all available options for the `ProjectManager`. 463 | */ 464 | declare class ProjectManagerOptions { 465 | 466 | /** 467 | * Transfer mode setting: Copy source media 468 | */ 469 | readonly CLIP_TRANSFER_COPY: string 470 | 471 | /** 472 | * Transfer mode setting: Transcode source media 473 | */ 474 | readonly CLIP_TRANSFER_TRANSCODE: string 475 | 476 | /** 477 | * Transcode mode setting: Transcode source media to a specific preset 478 | */ 479 | readonly CLIP_TRANSCODE_MATCH_PRESET: string 480 | 481 | /** 482 | * Transcode mode setting: Transcode source media to match clips 483 | */ 484 | readonly CLIP_TRANSCODE_MATCH_CLIPS: string 485 | 486 | /** 487 | * Transcode mode setting: Transcode source media to match sequence settings 488 | */ 489 | readonly CLIP_TRANSCODE_MATCH_SEQUENCE: string 490 | 491 | /** 492 | * Which transcode option to use; will be one of these: 493 | * `CLIP_TRANSCODE_MATCH_PRESET` 494 | * `CLIP_TRANSCODE_MATCH_CLIPS` 495 | * `CLIP_TRANSCODE_MATCH_SEQUENCE` 496 | */ 497 | clipTranscoderOption: string 498 | 499 | /** 500 | * Which transfer option to use; will be one of these: 501 | * `CLIP_TRANSFER_COPY` 502 | * `CLIP_TRANSFER_TRANSCODE` 503 | */ 504 | clipTransferOption 505 | 506 | /** 507 | * If `true`, projectItems not used in a sequence are not transferred 508 | */ 509 | excludeUnused : boolean 510 | 511 | /** 512 | * The number of 'handle' frames to provide, before and after the in/out points of clips in the sequence. 513 | */ 514 | handleFrameCount : number 515 | 516 | /** 517 | * If `true`, preview files will also be transferred. 518 | */ 519 | includePreviews : boolean 520 | 521 | /** 522 | * If `true`, conformed audio files will also be transferred. 523 | */ 524 | includeConformedAudio : boolean 525 | 526 | /** 527 | * If `true`, media files will be renamed to match clip names. 528 | */ 529 | renameMedia : boolean 530 | 531 | /** 532 | * The containing directory for the consolidation/transfer. 533 | */ 534 | destinationPath : String 535 | 536 | /** 537 | * If `true`, all sequences in the project will be transferred. 538 | */ 539 | includeAllSequences : boolean 540 | 541 | /** 542 | * An `Array` of all sequences affected by the transfer. 543 | */ 544 | affectedSequences : Array 545 | 546 | /** 547 | * Path the the encoder preset (.epr file) to be used. 548 | */ 549 | encoderPresetFilePath : String 550 | 551 | /** 552 | * If `true`, image sequences will be transcoded. 553 | */ 554 | convertImageSequencesToClips : boolean 555 | 556 | /** 557 | * If `true`, synthetic importer clips will be transcoded. 558 | */ 559 | convertSyntheticsToClips : boolean 560 | 561 | /** 562 | * If `true`, After Effects compositions will be transcoded. 563 | */ 564 | convertAECompsToClips : boolean 565 | 566 | /** 567 | * If `true`, source media will be copied not transcoded, if transcoding would have resulted in loss of alpha information. 568 | */ 569 | copyToPreventAlphaLoss : boolean 570 | } 571 | 572 | declare class ProjectManager { 573 | 574 | /** 575 | * An array of strings describing errors encountered. 576 | */ 577 | errors : Array 578 | 579 | /** 580 | * The `ProjectManagerOptions` structure. 581 | */ 582 | options : ProjectManagerOptions 583 | 584 | /** 585 | * Perform the consolidation and transfer. 586 | * @param project the `Project` to consolidate. 587 | */ 588 | process(project:Project): number 589 | 590 | /** 591 | * 592 | */ 593 | unbind(eventName: string): void 594 | } 595 | 596 | /** 597 | * 598 | */ 599 | declare class SequenceCollection { 600 | /** 601 | * 602 | */ 603 | readonly numSequences: number 604 | 605 | /** 606 | * 607 | */ 608 | bind(eventName: string, function_: any): void 609 | 610 | /** 611 | * 612 | */ 613 | setTimeout(eventName: string, function_: any, milliseconds: number): void 614 | 615 | /** 616 | * 617 | */ 618 | unbind(eventName: string): void 619 | } 620 | 621 | /** 622 | * 623 | */ 624 | declare class Metadata { 625 | /** 626 | * 627 | */ 628 | readonly getMetadata: string 629 | 630 | /** 631 | * 632 | */ 633 | addMarker(): void 634 | 635 | /** 636 | * 637 | */ 638 | bind(eventName: string, function_: any): void 639 | 640 | /** 641 | * 642 | */ 643 | deleteMarker(): void 644 | 645 | /** 646 | * 647 | */ 648 | setMarkerData(): void 649 | 650 | /** 651 | * 652 | */ 653 | setMetadataValue(): void 654 | 655 | /** 656 | * 657 | */ 658 | setTimeout(eventName: string, function_: any, milliseconds: number): void 659 | 660 | /** 661 | * 662 | */ 663 | unbind(eventName: string): void 664 | 665 | /** 666 | * 667 | */ 668 | updateMarker(): void 669 | } 670 | 671 | /** 672 | * 673 | */ 674 | declare class Anywhere { 675 | /** 676 | * 677 | */ 678 | bind(eventName: string, function_: any): void 679 | 680 | /** 681 | * 682 | */ 683 | getAuthenticationToken(): string 684 | 685 | /** 686 | * 687 | */ 688 | getCurrentEditingSessionActiveSequenceURL(): string 689 | 690 | /** 691 | * 692 | */ 693 | getCurrentEditingSessionSelectionURL(): string 694 | 695 | /** 696 | * 697 | */ 698 | getCurrentEditingSessionURL(): string 699 | 700 | /** 701 | * 702 | */ 703 | isProductionOpen(): boolean 704 | 705 | /** 706 | * @returns An array of open productions (), or null if no productions are open. 707 | */ 708 | listProductions(): RemoteProductionCollection 709 | 710 | /** 711 | * 712 | */ 713 | openProduction(inProductionURL: string): boolean 714 | 715 | /** 716 | * 717 | */ 718 | setAuthenticationToken(inAuthToken: string, inEmail: string): boolean 719 | 720 | /** 721 | * 722 | */ 723 | setTimeout(eventName: string, function_: any, milliseconds: number): void 724 | 725 | /** 726 | * 727 | */ 728 | unbind(eventName: string): void 729 | } 730 | 731 | /** 732 | * 733 | */ 734 | declare class CsxsResourceCentral { 735 | /** 736 | * 737 | */ 738 | bind(eventName: string, function_: any): void 739 | 740 | /** 741 | * 742 | */ 743 | getBrightness(): string 744 | 745 | /** 746 | * 747 | */ 748 | openURL(urlString: string): void 749 | 750 | /** 751 | * 752 | */ 753 | setTimeout(eventName: string, function_: any, milliseconds: number): void 754 | 755 | /** 756 | * 757 | */ 758 | unbind(eventName: string): void 759 | 760 | /** 761 | * 762 | */ 763 | validateClient(token: string): boolean 764 | } 765 | 766 | /** 767 | * 768 | */ 769 | declare class SourceMonitor { 770 | /** 771 | * 772 | */ 773 | bind(eventName: string, function_: any): void 774 | 775 | /** 776 | * 777 | */ 778 | closeAllClips(): void 779 | 780 | /** 781 | * 782 | */ 783 | closeClip(): void 784 | 785 | /** 786 | * 787 | */ 788 | openFilePath(filePath: string): boolean 789 | 790 | /** 791 | * 792 | */ 793 | play(speed?: number): void 794 | 795 | /** 796 | * 797 | */ 798 | setTimeout(eventName: string, function_: any, milliseconds: number): void 799 | 800 | /** 801 | * 802 | */ 803 | unbind(eventName: string): void 804 | 805 | /** 806 | * 807 | */ 808 | getPosition(): Time 809 | 810 | /** 811 | * 812 | */ 813 | openProjectItem(itemToOpen:ProjectItem): void 814 | 815 | } 816 | 817 | /** 818 | * 819 | */ 820 | declare class Time { 821 | /** 822 | * 823 | */ 824 | seconds: number 825 | 826 | /** 827 | * 828 | */ 829 | ticks: string 830 | 831 | /** 832 | * 833 | */ 834 | bind(eventName: string, function_: any): void 835 | 836 | /** 837 | * 838 | */ 839 | getFormatted(Time, whichFormat:number): String 840 | 841 | /** 842 | * 843 | */ 844 | setTimeout(eventName: string, function_: any, milliseconds: number): void 845 | 846 | /** 847 | * 848 | */ 849 | unbind(eventName: string): void 850 | } 851 | 852 | /** 853 | * 854 | */ 855 | declare class ProjectItemType { 856 | /** 857 | * 858 | */ 859 | static readonly BIN: number 860 | 861 | /** 862 | * 863 | */ 864 | static readonly CLIP: number 865 | 866 | /** 867 | * 868 | */ 869 | static readonly FILE: number 870 | 871 | /** 872 | * 873 | */ 874 | static readonly ROOT: number 875 | 876 | /** 877 | * 878 | */ 879 | bind(eventName: string, function_: any): void 880 | 881 | /** 882 | * 883 | */ 884 | setTimeout(eventName: string, function_: any, milliseconds: number): void 885 | 886 | /** 887 | * 888 | */ 889 | unbind(eventName: string): void 890 | } 891 | 892 | 893 | /** 894 | * 895 | */ 896 | declare class Project { 897 | /** 898 | *f 899 | */ 900 | activeSequence: Sequence 901 | 902 | /** 903 | * 904 | */ 905 | readonly documentID: string 906 | 907 | /** 908 | * 909 | */ 910 | readonly name: string 911 | 912 | /** 913 | * 914 | */ 915 | readonly path: string 916 | 917 | /** 918 | * 919 | */ 920 | readonly rootItem: ProjectItem 921 | 922 | /** 923 | * 924 | */ 925 | readonly sequences: SequenceCollection 926 | 927 | /** 928 | * 929 | */ 930 | addPropertyToProjectMetadataSchema(name: string, label: string, type: number): boolean 931 | 932 | /** 933 | * 934 | */ 935 | bind(eventName: string, function_: any): void 936 | 937 | /** 938 | * @param saveBeforeClosing: boolean, indicating whether to save the project before closing 939 | * @param promptUserIfDirty: boolean, indicating whether to prompt the user to save before closing 940 | */ 941 | closeDocument(saveBeforeClosing?: boolean, promptUserIfDirty?: boolean): boolean 942 | 943 | /** 944 | * 945 | */ 946 | createNewSequence(sequenceName: string, placeholderID: string): void 947 | 948 | /** 949 | * 950 | */ 951 | deleteAsset(): void 952 | 953 | /** 954 | * 955 | */ 956 | deleteSequence(sequence: Sequence): boolean 957 | 958 | /** 959 | * 960 | */ 961 | exportAAF( 962 | sequence: Sequence, 963 | filePath: string, 964 | mixDownVideo: number, 965 | explodeToMono: number, 966 | sampleRate: number, 967 | bitsPerSample: number, 968 | embedAudio: number, 969 | audioFileFormat: number, 970 | trimSources: number, 971 | handleFrames: number, 972 | ): number 973 | 974 | /** 975 | * 976 | */ 977 | exportFinalCutProXML(exportPath: string, suppressUI: number): boolean 978 | 979 | /** 980 | * 981 | */ 982 | consolidateDuplicates(): void 983 | 984 | /** 985 | * 986 | */ 987 | exportOMF( 988 | sequence: Sequence, 989 | filePath: string, 990 | OMFTitle: string, 991 | sampleRate: number, 992 | bitsPerSample: number, 993 | audioEncapsulated: number, 994 | audioFileFormat: number, 995 | trimAudioFiles: number, 996 | handleFrames: number, 997 | includePan: number, 998 | ): number 999 | 1000 | /** 1001 | * 1002 | */ 1003 | exportTimeline(exportControllerName: string): number 1004 | 1005 | /** 1006 | * 1007 | */ 1008 | getInsertionBin(): ProjectItem 1009 | 1010 | /** 1011 | * 1012 | */ 1013 | getProjectPanelMetadata(): string 1014 | 1015 | /** 1016 | * 1017 | */ 1018 | importAEComps(aepPath: String, compsToImport: Array, projectBin: ProjectItem): boolean 1019 | 1020 | /** 1021 | * 1022 | */ 1023 | importAllAEComps(aepPath: String, projectBin: ProjectItem): boolean 1024 | 1025 | /** 1026 | * Imports files into the project. 1027 | * @param arrayOfFilePathsToImport An array of paths to files to import 1028 | * @param suppressUI optional; if true, suppress any warnings, translation reports, or errors. 1029 | * @param projectBin optional; if present, the bin into which to import the new media. 1030 | * @param importAsNumberedStill optiona; if present, interprets the file paths as a series of numbered stills. 1031 | */ 1032 | importFiles(arrayOfFilePathsToImport: string[], suppressUI?: boolean, projectBin?: ProjectItem, importAsNumberedStill?: boolean): boolean 1033 | 1034 | /** 1035 | * Imports sequences from a project. 1036 | * @param projectPath Path to project from which to import sequences. 1037 | * @param sequences An array of sequence IDs to import, from the project. 1038 | */ 1039 | importSequences(projectPath: String, sequencesToImport: Array): boolean 1040 | 1041 | /** 1042 | * 1043 | */ 1044 | openSequence(sequenceID: string): boolean 1045 | 1046 | /** 1047 | * 1048 | */ 1049 | pauseGrowing(pausedOrNot: number): boolean 1050 | 1051 | /** 1052 | * 1053 | */ 1054 | placeAsset(arg1: any): boolean 1055 | 1056 | /** 1057 | * 1058 | */ 1059 | save(): void 1060 | 1061 | /** 1062 | * 1063 | */ 1064 | saveAs(saveAsPath: string): boolean 1065 | 1066 | /** 1067 | * 1068 | */ 1069 | setProjectPanelMetadata(newMetadata: string): void 1070 | 1071 | /** 1072 | * 1073 | * @param newSequenceName Name for newly-created sequence 1074 | * @param projectItems Array of project items to be added to sequence 1075 | * @param targetBin Bin in which new sequence should be created 1076 | */ 1077 | 1078 | createNewSequenceFromClips(newSequenceName: string, projectItems: Array, targetBin: ProjectItem) 1079 | 1080 | /** 1081 | * 1082 | */ 1083 | getSupportedGraphicsWhiteLuminances(): Array 1084 | 1085 | /** 1086 | * 1087 | */ 1088 | getGraphicsWhiteLuminance(): number 1089 | 1090 | /** 1091 | * 1092 | * @param newGWL 1093 | */ 1094 | setGraphicsWhiteLuminance(newGWL:number): boolean 1095 | 1096 | /** 1097 | * 1098 | */ 1099 | setTimeout(eventName: string, function_: any, milliseconds: number): void 1100 | 1101 | /** 1102 | * 1103 | */ 1104 | unbind(eventName: string): void 1105 | } 1106 | 1107 | /** 1108 | * 1109 | */ 1110 | declare class Track { 1111 | /** 1112 | * 1113 | */ 1114 | name: String 1115 | 1116 | /** 1117 | * 1118 | */ 1119 | readonly clips: TrackItemCollection 1120 | 1121 | /** 1122 | * 1123 | */ 1124 | readonly id: number 1125 | 1126 | /** 1127 | * 1128 | */ 1129 | readonly mediaType: string 1130 | 1131 | /** 1132 | * 1133 | */ 1134 | readonly transitions: TrackItemCollection 1135 | 1136 | /** 1137 | * 1138 | */ 1139 | bind(eventName: string, function_: any): void 1140 | 1141 | /** 1142 | * 1143 | */ 1144 | insertClip(clipProjectItem: ProjectItem, time: number): void 1145 | 1146 | /** 1147 | * 1148 | */ 1149 | isMuted(): boolean 1150 | 1151 | /** 1152 | * 1153 | */ 1154 | overwriteClip(clipProjectItem: ProjectItem, time: number): void 1155 | 1156 | /** 1157 | * 1158 | */ 1159 | setMute(arg1?: number): void 1160 | 1161 | /** 1162 | * 1163 | */ 1164 | setTimeout(eventName: string, function_: any, milliseconds: number): void 1165 | 1166 | /** 1167 | * 1168 | */ 1169 | isTargeted(): Boolean 1170 | 1171 | /** 1172 | * 1173 | */ 1174 | setTargeted(isTargeted:Boolean, shouldBroadcast:Boolean): Boolean 1175 | 1176 | /** 1177 | * 1178 | */ 1179 | unbind(eventName: string): void 1180 | } 1181 | 1182 | /** 1183 | * 1184 | */ 1185 | declare class TrackItem { 1186 | /** 1187 | * 1188 | */ 1189 | readonly components: any 1190 | 1191 | /** 1192 | * 1193 | */ 1194 | readonly duration: Time 1195 | 1196 | /** 1197 | * 1198 | */ 1199 | end: Time 1200 | 1201 | /** 1202 | * 1203 | */ 1204 | inPoint: Time 1205 | 1206 | /** 1207 | * 1208 | */ 1209 | outPoint: Time 1210 | 1211 | /** 1212 | * 1213 | */ 1214 | readonly mediaType: string 1215 | 1216 | /** 1217 | * 1218 | */ 1219 | name: string 1220 | 1221 | /** 1222 | * 1223 | */ 1224 | projectItem: ProjectItem 1225 | 1226 | /** 1227 | * 1228 | */ 1229 | disabled: boolean 1230 | /** 1231 | * 1232 | */ 1233 | readonly start: Time 1234 | 1235 | /** 1236 | * 1237 | */ 1238 | readonly type: number 1239 | 1240 | /** 1241 | * 1242 | */ 1243 | readonly nodeId: string 1244 | 1245 | /** 1246 | * 1247 | */ 1248 | bind(eventName: string, function_: any): void 1249 | 1250 | /** 1251 | * 1252 | */ 1253 | getLinkedItems(): TrackItemCollection 1254 | 1255 | /** 1256 | * 1257 | */ 1258 | isSelected(): boolean 1259 | 1260 | /** 1261 | * 1262 | */ 1263 | isSpeedReversed(): boolean 1264 | 1265 | /** 1266 | * 1267 | */ 1268 | setSelected(isSelected: boolean, updateUI?: boolean): void 1269 | 1270 | /** 1271 | * 1272 | */ 1273 | isAdjustmentLayer(): boolean 1274 | 1275 | /** 1276 | * 1277 | */ 1278 | remove(rippleEdit:boolean, alignToVideo:boolean): boolean 1279 | 1280 | /** 1281 | * 1282 | */ 1283 | getSpeed(): number 1284 | 1285 | /** 1286 | * Returns whether the trackItem represents a MOGRT. 1287 | * @returns true, if trackItem is a MOGRT. 1288 | */ 1289 | isMGT(): boolean 1290 | 1291 | /** 1292 | * 1293 | */ 1294 | getMGTComponent(): any 1295 | 1296 | /** 1297 | * 1298 | */ 1299 | getColorSpace(): String 1300 | 1301 | /** 1302 | * 1303 | */ 1304 | setTimeout(eventName: string, function_: any, milliseconds: number): void 1305 | 1306 | /** 1307 | * 1308 | */ 1309 | unbind(eventName: string): void 1310 | } 1311 | 1312 | /** 1313 | * 1314 | */ 1315 | declare class ProjectItem { 1316 | /** 1317 | * 1318 | */ 1319 | readonly children: ProjectItemCollection 1320 | 1321 | /** 1322 | * 1323 | */ 1324 | name: string 1325 | 1326 | /** 1327 | * 1328 | */ 1329 | readonly nodeId: string 1330 | 1331 | /** 1332 | * 1333 | */ 1334 | readonly treePath: string 1335 | 1336 | /** 1337 | * 1338 | */ 1339 | readonly type: number 1340 | 1341 | /** 1342 | * 1343 | */ 1344 | readonly videoComponents: any 1345 | 1346 | /** 1347 | * Timebase in ticks after frame rate interpretation has been applied 1348 | */ 1349 | readonly interpretedTimebase: string 1350 | 1351 | /** 1352 | * Timebase in ticks of source media without frame rate interpretation 1353 | */ 1354 | readonly sourceTimebase: string 1355 | 1356 | /** 1357 | * 1358 | */ 1359 | attachProxy(mediaPath: string, isHiRes: number): boolean 1360 | 1361 | /** 1362 | * 1363 | */ 1364 | detachProxy(): boolean 1365 | 1366 | /** 1367 | * 1368 | */ 1369 | bind(eventName: string, function_: any): void 1370 | 1371 | /** 1372 | * 1373 | */ 1374 | canChangeMediaPath(): boolean 1375 | 1376 | /** 1377 | * 1378 | */ 1379 | canProxy(): boolean 1380 | 1381 | /** 1382 | * 1383 | */ 1384 | changeMediaPath(mediaPath: string, suppressWarnings: boolean): boolean 1385 | 1386 | /** 1387 | * 1388 | */ 1389 | createBin(name: string): ProjectItem 1390 | 1391 | /** 1392 | * 1393 | */ 1394 | createSmartBin(name: string, query: string): void 1395 | 1396 | /** 1397 | * Returns whether the projectItem represents a sequence. 1398 | * @returns true, if projectItem is a sequence. 1399 | */ 1400 | isSequence(): boolean 1401 | 1402 | /** 1403 | * 1404 | */ 1405 | createSubClip( 1406 | name: string, 1407 | startTime: object, 1408 | endTime: object, 1409 | hasHardBoundaries: number, 1410 | takeVideo?: number, 1411 | takeAudio?: number, 1412 | ): ProjectItem 1413 | 1414 | /** 1415 | * 1416 | */ 1417 | deleteBin(): void 1418 | 1419 | /** 1420 | * 1421 | */ 1422 | findItemsMatchingMediaPath(matchString: string, ignoreSubclips?: number): void 1423 | 1424 | /** 1425 | * 1426 | */ 1427 | getColorLabel(): number 1428 | 1429 | /** 1430 | * 1431 | */ 1432 | getMarkers(): MarkerCollection 1433 | 1434 | /** 1435 | * 1436 | */ 1437 | getMediaPath(): string 1438 | 1439 | /** 1440 | * 1441 | */ 1442 | getProjectMetadata(): string 1443 | 1444 | /** 1445 | * 1446 | */ 1447 | getProxyPath(): string 1448 | 1449 | /** 1450 | * 1451 | */ 1452 | getXMPMetadata(): string 1453 | 1454 | /** 1455 | * 1456 | */ 1457 | hasProxy(): boolean 1458 | 1459 | /** 1460 | * 1461 | */ 1462 | moveBin(destination: ProjectItem): void 1463 | 1464 | /** 1465 | * 1466 | */ 1467 | refreshMedia(): string 1468 | 1469 | /** 1470 | * 1471 | */ 1472 | renameBin(name: string): boolean 1473 | 1474 | /** 1475 | * 1476 | */ 1477 | select(): void 1478 | 1479 | /** 1480 | * 1481 | */ 1482 | setColorLabel(newColor: number): void 1483 | 1484 | /** 1485 | * 1486 | */ 1487 | setOverridePixelAspectRatio(numerator: number, denominator: number): boolean 1488 | 1489 | /** 1490 | * 1491 | */ 1492 | setOverrideFrameRate(newFrameRate: number): boolean 1493 | 1494 | /** 1495 | * 1496 | */ 1497 | setProjectMetadata(buffer: String, keysToBeUpdated: Array): void 1498 | 1499 | /** 1500 | * 1501 | */ 1502 | setScaleToFrameSize(): void 1503 | 1504 | /** 1505 | * 1506 | */ 1507 | setStartTime(arg1: object): void 1508 | 1509 | /** 1510 | * 1511 | */ 1512 | setTimeout(eventName: string, function_: any, milliseconds: number): void 1513 | 1514 | /** 1515 | * 1516 | */ 1517 | setXMPMetadata(buffer: String): boolean 1518 | 1519 | /** 1520 | * 1521 | */ 1522 | startTime(): Time 1523 | 1524 | /** 1525 | * @returns The original color space associated with the unmodified Item 1526 | */ 1527 | 1528 | getOriginalColorSpace() : colorSpace 1529 | 1530 | 1531 | /** 1532 | * 1533 | * @param newColorSpace value must be available via sequence.workingColorSpaceList 1534 | */ 1535 | setOverrideColorSpace(newColorSpace: colorSpace): void 1536 | 1537 | /** 1538 | * @returns the color space currently in use 1539 | */ 1540 | getColorSpace(): colorSpace 1541 | 1542 | /** 1543 | * 1544 | */ 1545 | isMulticamClip(): boolean 1546 | 1547 | /** 1548 | * 1549 | */ 1550 | isMergedClip(): boolean 1551 | 1552 | /** 1553 | * 1554 | * @returns boolean indicating whether projectItem is offline. 1555 | */ 1556 | isOffline(): boolean 1557 | 1558 | /** 1559 | * 1560 | * @returns a boolean indicating whether setting the projectItem offline was successful. 1561 | */ 1562 | setOffline(): boolean 1563 | 1564 | /** 1565 | * 1566 | * @returns a footageInterpretation object, or null if none was available. 1567 | */ 1568 | getFootageInterpretation(): FootageInterpretation 1569 | 1570 | /** 1571 | * 1572 | * @param FootageInterpretation object containing desired settings 1573 | * @returns a boolean indicating whether setting the interpretation was successful. 1574 | */ 1575 | setFootageInterpretation(FootageInterpretation): boolean 1576 | 1577 | /** 1578 | * 1579 | * @returns an audio channel mapping object, or null if none was available. 1580 | */ 1581 | getAudioChannelMapping: AudioChannelMapping 1582 | 1583 | /** 1584 | * 1585 | * @param AudioChannelMapping object describing desired audio channel mapping. 1586 | * @returns boolean indicating whether setting the audio channel mapping was successful. 1587 | */ 1588 | setAudioChannelMapping(mapping:AudioChannelMapping): boolean 1589 | 1590 | /** 1591 | * @returns the LUT embedded with the original media 1592 | */ 1593 | getEmbeddedLUTID(): number 1594 | 1595 | /** 1596 | * @returns the LUT currently associated with the media 1597 | */ 1598 | 1599 | getInputLUTID(): number 1600 | /** 1601 | * 1602 | */ 1603 | unbind(eventName: string): void 1604 | } 1605 | 1606 | /** 1607 | * 1608 | */ 1609 | declare class ProjectCollection { 1610 | /** 1611 | * 1612 | */ 1613 | readonly numProjects: number 1614 | 1615 | /** 1616 | * 1617 | */ 1618 | bind(eventName: string, function_: any): void 1619 | 1620 | /** 1621 | * 1622 | */ 1623 | setTimeout(eventName: string, function_: any, milliseconds: number): void 1624 | 1625 | /** 1626 | * 1627 | */ 1628 | unbind(eventName: string): void 1629 | } 1630 | 1631 | /** 1632 | * 1633 | */ 1634 | declare class ProjectItemCollection { 1635 | /** 1636 | * 1637 | */ 1638 | readonly numItems: number 1639 | 1640 | /** 1641 | * 1642 | */ 1643 | bind(eventName: string, function_: any): void 1644 | 1645 | /** 1646 | * 1647 | */ 1648 | setTimeout(eventName: string, function_: any, milliseconds: number): void 1649 | 1650 | /** 1651 | * 1652 | */ 1653 | unbind(eventName: string): void 1654 | 1655 | /** 1656 | * 1657 | */ 1658 | [index: number]: ProjectItem 1659 | } 1660 | 1661 | /** 1662 | * 1663 | */ 1664 | declare class TrackCollection { 1665 | /** 1666 | * 1667 | */ 1668 | readonly numTracks: number 1669 | 1670 | /** 1671 | * 1672 | */ 1673 | bind(eventName: string, function_: any): void 1674 | 1675 | /** 1676 | * 1677 | */ 1678 | setTimeout(eventName: string, function_: any, milliseconds: number): void 1679 | 1680 | /** 1681 | * 1682 | */ 1683 | unbind(eventName: string): void 1684 | 1685 | /** 1686 | * 1687 | */ 1688 | [index: number]: Track 1689 | } 1690 | 1691 | /** 1692 | * 1693 | */ 1694 | declare class TrackItemCollection { 1695 | 1696 | /**Number of items 1697 | * 1698 | */ 1699 | readonly numItems: number 1700 | 1701 | /** 1702 | * 1703 | */ 1704 | bind(eventName: string, function_: any): void 1705 | 1706 | /** 1707 | * 1708 | */ 1709 | setTimeout(eventName: string, function_: any, milliseconds: number): void 1710 | 1711 | /** 1712 | * 1713 | */ 1714 | unbind(eventName: string): void 1715 | 1716 | /** 1717 | * 1718 | */ 1719 | [index: number]: TrackItem 1720 | } 1721 | 1722 | /** 1723 | * 1724 | */ 1725 | declare class ScratchDiskType { 1726 | /** 1727 | * 1728 | */ 1729 | static readonly FirstAudioCaptureFolder: string 1730 | 1731 | /** 1732 | * 1733 | */ 1734 | static readonly FirstAudioPreviewFolder: string 1735 | 1736 | /** 1737 | * 1738 | */ 1739 | static readonly FirstAutoSaveFolder: string 1740 | 1741 | /** 1742 | * 1743 | */ 1744 | static readonly FirstCClibrariesFolder: string 1745 | 1746 | /** 1747 | * 1748 | */ 1749 | static readonly FirstCapsuleMediaFolder: string 1750 | 1751 | /** 1752 | * 1753 | */ 1754 | static readonly FirstVideoCaptureFolder: string 1755 | 1756 | /** 1757 | * 1758 | */ 1759 | static readonly FirstVideoPreviewFolder: string 1760 | 1761 | /** 1762 | * 1763 | */ 1764 | bind(eventName: string, function_: any): void 1765 | 1766 | /** 1767 | * 1768 | */ 1769 | setTimeout(eventName: string, function_: any, milliseconds: number): void 1770 | 1771 | /** 1772 | * 1773 | */ 1774 | unbind(eventName: string): void 1775 | } 1776 | 1777 | /** 1778 | * 1779 | */ 1780 | declare class Csxs { 1781 | /** 1782 | * 1783 | */ 1784 | readonly resourceCentral: CsxsResourceCentral 1785 | 1786 | /** 1787 | * 1788 | */ 1789 | bind(eventName: string, function_: any): void 1790 | 1791 | /** 1792 | * 1793 | */ 1794 | setTimeout(eventName: string, function_: any, milliseconds: number): void 1795 | 1796 | /** 1797 | * 1798 | */ 1799 | unbind(eventName: string): void 1800 | } 1801 | 1802 | /** 1803 | * 1804 | */ 1805 | declare class RemoteProductionCollection { 1806 | /** 1807 | * 1808 | */ 1809 | readonly numProductions: number 1810 | 1811 | /** 1812 | * 1813 | */ 1814 | bind(eventName: string, function_: any): void 1815 | 1816 | /** 1817 | * 1818 | */ 1819 | setTimeout(eventName: string, function_: any, milliseconds: number): void 1820 | 1821 | /** 1822 | * 1823 | */ 1824 | unbind(eventName: string): void 1825 | } 1826 | 1827 | /** 1828 | * 1829 | */ 1830 | declare class RemoteProduction { 1831 | /** 1832 | * 1833 | */ 1834 | readonly description: string 1835 | 1836 | /** 1837 | * 1838 | */ 1839 | readonly name: string 1840 | 1841 | /** 1842 | * 1843 | */ 1844 | readonly url: string 1845 | 1846 | /** 1847 | * 1848 | */ 1849 | bind(eventName: string, function_: any): void 1850 | 1851 | /** 1852 | * 1853 | */ 1854 | setTimeout(eventName: string, function_: any, milliseconds: number): void 1855 | 1856 | /** 1857 | * 1858 | */ 1859 | unbind(eventName: string): void 1860 | } 1861 | 1862 | /** 1863 | * 1864 | */ 1865 | declare class Encoder { 1866 | /** 1867 | * 1868 | */ 1869 | readonly ENCODE_ENTIRE: number 1870 | 1871 | /** 1872 | * 1873 | */ 1874 | readonly ENCODE_IN_TO_OUT: number 1875 | 1876 | /** 1877 | * 1878 | */ 1879 | readonly ENCODE_WORKAREA: number 1880 | 1881 | /** 1882 | * 1883 | */ 1884 | bind(eventName: string, function_: any): void 1885 | 1886 | /** 1887 | * 1888 | */ 1889 | encodeFile( 1890 | inputFilePath: string, 1891 | outputFilePath: string, 1892 | presetPath: string, 1893 | removeOnCompletion?: number, 1894 | startTime?: object, 1895 | stopTime?: object, 1896 | ): string 1897 | 1898 | /** 1899 | * 1900 | */ 1901 | encodeProjectItem( 1902 | projectItem: ProjectItem, 1903 | outputFilePath: string, 1904 | presetPath: string, 1905 | WorkAreaType?: number, 1906 | removeOnCompletion?: number, 1907 | ): string 1908 | 1909 | /** 1910 | * 1911 | */ 1912 | encodeSequence( 1913 | sequence: Sequence, 1914 | outputFilePath: string, 1915 | presetPath: string, 1916 | WorkAreaType?: number, 1917 | removeOnCompletion?: number, 1918 | startQueueImmediately?: boolean, 1919 | ): string 1920 | 1921 | /** 1922 | * @returns an array of available exporters, or null if no exporters are available. 1923 | */ 1924 | getExporters(): Array 1925 | /** 1926 | * 1927 | */ 1928 | launchEncoder(): boolean 1929 | 1930 | /** 1931 | * 1932 | */ 1933 | setEmbeddedXMPEnabled(enable: number): void 1934 | 1935 | /** 1936 | * 1937 | */ 1938 | setSidecarXMPEnabled(enable: number): void 1939 | 1940 | /** 1941 | * 1942 | */ 1943 | setTimeout(eventName: string, function_: any, milliseconds: number): void 1944 | 1945 | /** 1946 | * 1947 | */ 1948 | startBatch(): boolean 1949 | 1950 | /** 1951 | * 1952 | */ 1953 | lastExportMediaFolder():String 1954 | 1955 | /** 1956 | * 1957 | */ 1958 | unbind(eventName: string): void 1959 | } 1960 | 1961 | /** 1962 | * 1963 | */ 1964 | declare class Properties { 1965 | /** 1966 | * 1967 | */ 1968 | bind(eventName: string, function_: any): void 1969 | 1970 | /** 1971 | * @param propertyKey Indicates which property to clear. 1972 | */ 1973 | clearProperty(propertyKey: string): void 1974 | 1975 | /** 1976 | * 1977 | */ 1978 | doesPropertyExist(propertyKey: string): boolean 1979 | 1980 | /** 1981 | * 1982 | */ 1983 | getProperty(propertyKey: string): any 1984 | 1985 | /** 1986 | * 1987 | */ 1988 | isPropertyReadOnly(propertyKey: string): boolean 1989 | 1990 | /** 1991 | * 1992 | */ 1993 | setProperty(propertyKey: string, propertyValue: any, permanenceValue: number, allowCreateNewProperty: boolean): void 1994 | 1995 | /** 1996 | * 1997 | */ 1998 | setTimeout(eventName: string, function_: any, milliseconds: number): void 1999 | 2000 | /** 2001 | * 2002 | */ 2003 | unbind(eventName: string): void 2004 | } 2005 | /** 2006 | * 2007 | */ 2008 | declare class PrProduction { 2009 | /** 2010 | * 2011 | */ 2012 | name: string 2013 | 2014 | /** 2015 | * 2016 | */ 2017 | projects: Array 2018 | 2019 | /** 2020 | * 2021 | */ 2022 | close(): void 2023 | 2024 | /** 2025 | * 2026 | */ 2027 | getLocked(project:Project): Boolean 2028 | 2029 | /** 2030 | * 2031 | */ 2032 | setLocked(project:Project, newLockState: Boolean): void 2033 | 2034 | /** 2035 | * 2036 | */ 2037 | moveToTrash(projectPath:String, suppressUI:Boolean, saveProject:Boolean): Boolean 2038 | 2039 | } 2040 | /** 2041 | * 2042 | */ 2043 | declare class Application { 2044 | /** 2045 | * 2046 | */ 2047 | readonly anywhere: Anywhere 2048 | 2049 | /** 2050 | * 2051 | */ 2052 | readonly build: string 2053 | 2054 | /** 2055 | * 2056 | */ 2057 | readonly csxs: Csxs 2058 | 2059 | /** 2060 | * 2061 | */ 2062 | readonly encoder: Encoder 2063 | 2064 | /** 2065 | * 2066 | */ 2067 | readonly projectManager: ProjectManager 2068 | 2069 | 2070 | /** 2071 | * 2072 | */ 2073 | readonly getAppPrefPath: string 2074 | 2075 | /** 2076 | * 2077 | */ 2078 | readonly getAppSystemPrefPath: string 2079 | 2080 | /** 2081 | * 2082 | */ 2083 | readonly getPProPrefPath: string 2084 | 2085 | /** 2086 | * 2087 | */ 2088 | readonly getPProSystemPrefPath: string 2089 | 2090 | /** 2091 | * 2092 | */ 2093 | readonly metadata: Metadata 2094 | 2095 | /** 2096 | * This is the current active project. 2097 | */ 2098 | project: Project 2099 | 2100 | /** 2101 | * 2102 | */ 2103 | readonly projects: ProjectCollection 2104 | 2105 | /** 2106 | * 2107 | */ 2108 | readonly properties: Properties 2109 | 2110 | /** 2111 | * 2112 | */ 2113 | readonly sourceMonitor: SourceMonitor 2114 | 2115 | /** 2116 | * 2117 | */ 2118 | readonly userGuid: string 2119 | 2120 | /** 2121 | * 2122 | */ 2123 | readonly version: string 2124 | 2125 | /** 2126 | * 2127 | */ 2128 | bind(eventName: string, function_: any): void 2129 | 2130 | /** 2131 | * 2132 | */ 2133 | broadcastPrefsChanged(preferencesThatChanged: string): boolean 2134 | 2135 | /** 2136 | * 2137 | */ 2138 | getEnableProxies(): number 2139 | 2140 | /** 2141 | * Checks whether file specified is a doc 2142 | * @param filePath This is the path to be checked 2143 | * @returns true if the document at that path is openable as a PPro project 2144 | */ 2145 | isDocument(filePath: string): boolean 2146 | 2147 | /** 2148 | * 2149 | */ 2150 | isDocumentOpen(): boolean 2151 | 2152 | /** 2153 | * 2154 | */ 2155 | openDocument(filePath: string, bypassConversionDialog?: boolean, bypassLocateFile?: boolean, bypassWarningDialog?: boolean, hideFromMRUList?: boolean): boolean 2156 | 2157 | /** 2158 | * @param newValueForTranscodeOnIngest 2159 | * @returns Boolean indicating whether transcode on ingest is enabled. 2160 | */ 2161 | setEnableTranscodeOnIngest(newValueForTranscodeOnIngest: boolean) 2162 | 2163 | /** 2164 | * 2165 | */ 2166 | openFCPXML(): boolean 2167 | 2168 | /** 2169 | * 2170 | */ 2171 | quit(): void 2172 | 2173 | /** 2174 | * 2175 | */ 2176 | setEnableProxies(enable: number): boolean 2177 | 2178 | /** 2179 | * 2180 | */ 2181 | setExtensionPersistent(extensionID: string, state?: number): void 2182 | 2183 | /** 2184 | * 2185 | */ 2186 | setSDKEventMessage(value: string, eventType: string): boolean 2187 | 2188 | /** 2189 | * 2190 | */ 2191 | setScratchDiskPath(value: string, type: string): boolean 2192 | 2193 | /** 2194 | * 2195 | */ 2196 | setTimeout(eventName: string, function_: any, milliseconds: number): void 2197 | 2198 | /** 2199 | * 2200 | */ 2201 | getProjectViewIDs(): Array 2202 | 2203 | /** 2204 | * 2205 | */ 2206 | getProjectFromViewID(viewID:String): Project 2207 | 2208 | /** 2209 | * 2210 | */ 2211 | showCursor(enable: boolean): void 2212 | 2213 | /** 2214 | * 2215 | */ 2216 | getProjectViewSelection(viewID:String): Array 2217 | 2218 | /** 2219 | * 2220 | */ 2221 | getCurrentProjectViewSelection(viewID:String): Array 2222 | 2223 | /** 2224 | * 2225 | */ 2226 | setProjectViewSelection(projectItems:Array, viewID:String): void 2227 | 2228 | /** 2229 | * 2230 | */ 2231 | onItemAddedToProjectSuccess : undefined 2232 | 2233 | 2234 | /** 2235 | * @returns an array of the names of all available workspaces. 2236 | */ 2237 | getWorkspaces(): Array 2238 | 2239 | /** 2240 | * @param workspaceName Name of workspace to use 2241 | * @returns true if successful 2242 | */ 2243 | setWorkspace(workspaceName: string) 2244 | 2245 | /** 2246 | * 2247 | * @param eventName event to which to subscribe 2248 | * @param function_ function to be called 2249 | */ 2250 | addEventListener(eventName: string, function_: any): void 2251 | 2252 | /** 2253 | * 2254 | */ 2255 | trace(message: string): void 2256 | 2257 | /** 2258 | * 2259 | */ 2260 | unbind(eventName: string): void 2261 | 2262 | /** 2263 | * 2264 | */ 2265 | enableQE(): void 2266 | 2267 | /** 2268 | * 2269 | */ 2270 | newProject(projectName: string): boolean 2271 | 2272 | /** 2273 | * 2274 | */ 2275 | production: PrProduction 2276 | 2277 | /** 2278 | * 2279 | */ 2280 | openPrProduction(path:string): PrProduction 2281 | 2282 | } 2283 | 2284 | /** 2285 | * 2286 | */ 2287 | declare class MarkerCollection { 2288 | /** 2289 | * 2290 | */ 2291 | readonly numMarkers: number 2292 | 2293 | /** 2294 | * 2295 | */ 2296 | bind(eventName: string, function_: any): void 2297 | 2298 | /** 2299 | * 2300 | */ 2301 | createMarker(time: number): Marker 2302 | 2303 | /** 2304 | * 2305 | */ 2306 | deleteMarker(marker: Marker): void 2307 | 2308 | /** 2309 | * 2310 | */ 2311 | getFirstMarker(): Marker 2312 | 2313 | /** 2314 | * 2315 | */ 2316 | getLastMarker(): Marker 2317 | 2318 | /** 2319 | * 2320 | */ 2321 | getNextMarker(marker: Marker): Marker 2322 | 2323 | /** 2324 | * 2325 | */ 2326 | getPrevMarker(marker: Marker): Marker 2327 | 2328 | /** 2329 | * 2330 | */ 2331 | setTimeout(eventName: string, function_: any, milliseconds: number): void 2332 | 2333 | /** 2334 | * 2335 | */ 2336 | unbind(eventName: string): void 2337 | } 2338 | 2339 | /** 2340 | * 2341 | */ 2342 | declare class Marker { 2343 | /** 2344 | * 2345 | */ 2346 | comments: string 2347 | 2348 | /** 2349 | * 2350 | */ 2351 | end: Time 2352 | 2353 | /** 2354 | * 2355 | */ 2356 | readonly guid: string 2357 | 2358 | /** 2359 | * 2360 | */ 2361 | name: string 2362 | 2363 | /** 2364 | * 2365 | */ 2366 | start: Time 2367 | 2368 | /** 2369 | * 2370 | */ 2371 | type: string 2372 | 2373 | /** 2374 | * 2375 | */ 2376 | bind(eventName: string, function_: any): void 2377 | 2378 | /** 2379 | * 2380 | */ 2381 | getWebLinkFrameTarget(): string 2382 | 2383 | /** 2384 | * 2385 | */ 2386 | getWebLinkURL(): string 2387 | 2388 | /** 2389 | * 2390 | */ 2391 | setTimeout(eventName: string, function_: any, milliseconds: number): void 2392 | 2393 | /** 2394 | * 2395 | */ 2396 | setTypeAsChapter(): void 2397 | 2398 | /** 2399 | * 2400 | */ 2401 | setTypeAsComment(): void 2402 | 2403 | /** 2404 | * 2405 | */ 2406 | setTypeAsSegmentation(): void 2407 | 2408 | /** 2409 | * 2410 | */ 2411 | setTypeAsWebLink(url: string, frameTarget: string): void 2412 | 2413 | /** 2414 | * 2415 | */ 2416 | getColorByIndex(): number 2417 | 2418 | /** 2419 | * 2420 | */ 2421 | setColorByIndex(index:number): void 2422 | 2423 | /** 2424 | * 2425 | */ 2426 | unbind(eventName: string): void 2427 | } 2428 | 2429 | /** 2430 | * 2431 | */ 2432 | declare class Document { 2433 | /** 2434 | * 2435 | */ 2436 | bind(eventName: string, function_: any): void 2437 | 2438 | /** 2439 | * 2440 | */ 2441 | getFilePath(): string 2442 | 2443 | /** 2444 | * 2445 | */ 2446 | importFiles(arg1: any): boolean 2447 | 2448 | /** 2449 | * 2450 | */ 2451 | setTimeout(eventName: string, function_: any, milliseconds: number): void 2452 | 2453 | /** 2454 | * 2455 | */ 2456 | unbind(eventName: string): void 2457 | } 2458 | 2459 | /** 2460 | * In order to use qe please call app.enableQE() first. 2461 | */ 2462 | declare const qe: undefined | any 2463 | 2464 | interface SystemCompatibilityReport { 2465 | /** 2466 | * @param fullOutputPath The path and filename at which to write the report. 2467 | */ 2468 | CreateReport(fullOutputPath: string): void 2469 | } 2470 | 2471 | declare const SystemCompatibilityReport: SystemCompatibilityReport; 2472 | 2473 | --------------------------------------------------------------------------------