### Module Installation Configuration Example Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/configuration.md Example of configuring the 'installModules' option to include specific Node.js packages like 'unzipper', 'axios', and 'moment'. ```typescript { installModules: ["unzipper", "axios", "moment"], } ``` -------------------------------- ### Install Dependencies with npm Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/INDEX.md Installs project dependencies using npm. Run this before starting development. ```bash npm install ``` -------------------------------- ### Example: Build Configuration Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/configuration.md An example of build configuration, enabling source maps for development and setting JSXBIN mode to 'off'. ```typescript { build: { sourceMap: true, jsxBin: "off", }, } ``` -------------------------------- ### ZXP Configuration Example Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vite-cep-plugin.md Example of how to configure ZXP signing options, including multiple TSA URLs and build settings. ```typescript const config: CEP_Config = { zxp: { country: "US", province: "CA", org: "My Company", password: "mySecurePassword", tsa: [ "http://timestamp.digicert.com/", // Windows "http://timestamp.apple.com/ts01", // macOS ], allowSkipTSA: false, sourceMap: false, jsxBin: "off", }, // ... other config }; ``` -------------------------------- ### Example: UI Icons Configuration Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/configuration.md An example demonstrating how to specify paths for dark and light theme icons in both normal and hover states. ```typescript { iconDarkNormal: "./src/assets/light-icon.png", iconNormal: "./src/assets/dark-icon.png", iconDarkNormalRollOver: "./src/assets/light-icon-hover.png", iconNormalRollOver: "./src/assets/dark-icon-hover.png", } ``` -------------------------------- ### ZXP Signing Configuration Example Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/configuration.md An example of how to configure ZXP signing with specific country, province, organization, password, and TSA URLs. ```typescript { zxp: { country: "US", province: "CA", org: "My Company", password: "mySecurePassword", tsa: [ "http://timestamp.digicert.com/", "http://timestamp.apple.com/ts01", ], allowSkipTSA: false, sourceMap: false, jsxBin: "off", }, } ``` -------------------------------- ### Install Dependencies Source: https://github.com/hyperbrew/bolt-cep/blob/master/README.md Install project dependencies using your package manager. This step might be automatically handled by the create command. ```bash yarn ``` ```bash npm i ``` ```bash pnpm i ``` -------------------------------- ### Asset Copying Configuration Example Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/configuration.md Example demonstrating how to use 'copyAssets' and 'copyZipAssets' with various path patterns for including files and folders in the build and ZIP archive. ```typescript { copyAssets: [ "public", "custom/my.jsx", ], copyZipAssets: [ "instructions/*", "icons", "README.md", ], } ``` -------------------------------- ### CEF Command Parameters Example Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vite-cep-plugin.md Example of setting CEF launch parameters to enable Node.js integration, mixed context, and disable site isolation. ```typescript const config: CEP_Config = { parameters: [ "--v=0", "--enable-nodejs", "--mixed-context", "--disable-site-isolation-trials", ], // ... other config }; ``` -------------------------------- ### Start Development Server with HMR Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/INDEX.md Starts the development server with Hot Module Replacement (HMR) enabled for rapid development. ```bash npm run dev ``` -------------------------------- ### CEP Configuration Example Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vite-cep-plugin.md An example of how to configure multiple CEP panels within the Vite CEP plugin's configuration object. This shows setting up basic panel properties and event-driven startup. ```typescript const config: CEP_Config = { panels: [ { mainPath: "./main/index.html", name: "main", panelDisplayName: "My Extension", autoVisible: true, width: 600, height: 650, type: "Panel", }, { mainPath: "./settings/index.html", name: "settings", panelDisplayName: "Settings", autoVisible: false, width: 500, height: 400, startOnEvents: [ "com.adobe.csxs.events.ApplicationActivate", ], }, ], // ... other config }; ``` -------------------------------- ### Package Extension as ZXP Source: https://github.com/hyperbrew/bolt-cep/blob/master/README.md Build and package your extension into a ZXP file for delivery. The output is placed in the `dist/zxp` folder and can be installed using a ZXP installer. ```bash yarn zxp ``` ```bash npm run zxp ``` ```bash pnpm zxp ``` -------------------------------- ### Vite CEP Plugin Configuration Example Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vite-cep-plugin.md A comprehensive example of a vite-cep-plugin configuration file, demonstrating various options for versioning, host applications, panel settings, build, and ZXP packaging. ```typescript import type { CEP_Config } from "vite-cep-plugin"; import { version } from "./package.json"; const config: CEP_Config = { version, id: "com.mycompany.myextension", displayName: "My Extension", symlink: "local", port: 3000, servePort: 5000, startingDebugPort: 8860, extensionManifestVersion: 6.0, requiredRuntimeVersion: 9.0, hosts: [ { name: "AEFT", version: "[0.0,99.9]" }, { name: "PPRO", version: "[0.0,99.9]" }, ], type: "Panel", width: 500, height: 550, panels: [ { mainPath: "./main/index.html", name: "main", panelDisplayName: "My Extension", autoVisible: true, width: 600, height: 650, }, ], parameters: ["--v=0", "--enable-nodejs", "--mixed-context"], build: { jsxBin: "off", sourceMap: true, }, zxp: { country: "US", province: "CA", org: "My Company", password: "password123", tsa: [ "http://timestamp.digicert.com/", "http://timestamp.apple.com/ts01", ], allowSkipTSA: false, sourceMap: false, jsxBin: "off", }, installModules: [], copyAssets: ["public"], copyZipAssets: ["instructions/*"], }; export default config; ``` -------------------------------- ### Example CEP Host Configuration Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vite-cep-plugin.md An example of how to configure the 'hosts' property in your CEP extension configuration. This specifies compatibility with After Effects, Premiere Pro, and Illustrator. ```typescript const config: CEP_Config = { hosts: [ { name: "AEFT", version: "[0.0,99.9]" }, { name: "PPRO", version: "[0.0,99.9]" }, { name: "ILST", version: "[0.0,99.9]" }, ], // ... other config }; ``` -------------------------------- ### CEP Initialization (`src/j/lib/utils/init-cep.ts`) Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/project-structure.md Handles the initial setup for CEP extensions, including menu creation and event listener configuration. ```APIDOC ## CEP Initialization (`src/j/lib/utils/init-cep.ts`) ### Description This module is responsible for the initial setup and configuration of CEP extensions, ensuring that menus and event listeners are correctly established upon extension load. ### Exports - `initializeCEP(): Promise`: Sets up menus and event listeners for the CEP extension. ``` -------------------------------- ### Example: Common CEF Parameters Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/configuration.md Provides an example of common CEF parameters used to configure logging, Node.js integration, security contexts, and other browser behaviors. ```typescript { parameters: [ "--v=0", "--enable-nodejs", "--mixed-context", "--disable-site-isolation-trials", ], } ``` -------------------------------- ### Manual Installation of Bolt CEP Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/getting-started.md Clone the Bolt CEP repository and install dependencies manually. Ensure PlayerDebugMode is enabled and set up symlinks for development. ```bash # Clone the repository git clone https://github.com/hyperbrew/bolt-cep.git cd bolt-cep # Install dependencies npm install # or yarn / pnpm i # Enable PlayerDebugMode # (See troubleshooting in main README) # Create symlink to extension folder npm run symlink # Start development npm run dev ``` -------------------------------- ### File System Module Example Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/node-modules.md Demonstrates synchronous file system operations using the `fs` module. Check if a directory exists and list its contents. ```typescript import { fs, path } from "../lib/cep/node"; const prefsDir = "/path/to/prefs"; if (fs.existsSync(prefsDir)) { const files = fs.readdirSync(prefsDir); console.log("Files:", files); } ``` -------------------------------- ### Get Application Path (Legacy) Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vulcan-interface.md Retrieves the installation path of an application using the legacy API. Use `getAppPathEx()` for CEP 6.x and newer. ```typescript getAppPath(targetSpecifier: string): string ``` -------------------------------- ### Get Application Installation Path Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vulcan-interface.md Retrieves the full installation path for an Adobe Creative Cloud application. Returns an empty string if the application is not found. ```typescript const vulcan = new Vulcan(); const ppPath = vulcan.getAppPathEx(); if (ppPath) { console.log('App installed at:', ppPath); } ``` -------------------------------- ### ExtendScript Compilation Mode Example Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vite-cep-plugin.md Illustrates how to configure ExtendScript compilation modes for development and production builds. ```typescript const config: CEP_Config = { build: { jsxBin: "off", // Dev: use JavaScript }, zxp: { jsxBin: "replace", // Production: compile to JSXBIN // ... other zxp config }, // ... other config }; ``` -------------------------------- ### isAppInstalled() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vulcan-interface.md Checks if a specified CC application is installed on the system using the legacy API. ```APIDOC ## isAppInstalled() ### Description Check if application is installed (legacy API). ### Parameters #### Path Parameters - **targetSpecifier** (string) - Required - The identifier of the application to check. ### Returns boolean - True if the application is installed, false otherwise. ### Note Use `isAppInstalledEx()` for CEP 6.x and newer. ``` -------------------------------- ### Configure Invisible Panel Start Events Source: https://github.com/hyperbrew/bolt-cep/blob/master/README.md Configure invisible panels to launch from other panels using `csi.requestOpenExtension()` or via auto-start events defined in `startOnEvents`. ```typescript panels: [ { mainPath: "./main/index.html", name: "Invisible Bolt CEP", panelDisplayName: "", type: "Custom", startOnEvents: [ "com.adobe.csxs.events.ApplicationActivate", "com.adobe.csxs.events.ApplicationInitialized", "applicationActivate", ], ... } ] ``` -------------------------------- ### Check if Application is Installed (Legacy) Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vulcan-interface.md Checks if an application is installed using the legacy API. Use `isAppInstalledEx()` for CEP 6.x and newer. ```typescript isAppInstalled(targetSpecifier: string): boolean ``` -------------------------------- ### getAppPath() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vulcan-interface.md Retrieves the installation path of a specified CC application using the legacy API. ```APIDOC ## getAppPath() ### Description Get application installation path (legacy API). ### Parameters #### Path Parameters - **targetSpecifier** (string) - Required - The identifier of the application. ### Returns string - The installation path of the application. ### Note Use `getAppPathEx()` for CEP 6.x and newer. ``` -------------------------------- ### Create New Bolt CEP Project Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/getting-started.md Use this command to start a new project with Bolt CEP. Follow the interactive prompts to configure your project. ```bash npm create bolt-cep # or yarn create bolt-cep # or pnpm create bolt-cep ``` -------------------------------- ### Example: Multiple Panels Configuration Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/configuration.md Illustrates how to configure multiple panels with different paths, display names, visibility, and dimensions. Hidden panels can be achieved by setting panelDisplayName to an empty string and type to 'Custom'. ```typescript { panels: [ { mainPath: "./main/index.html", name: "main", panelDisplayName: "My Extension", autoVisible: true, width: 600, height: 650, }, { mainPath: "./settings/index.html", name: "settings", panelDisplayName: "Settings", autoVisible: false, width: 500, height: 400, }, { mainPath: "./background/index.html", name: "background", panelDisplayName: "", // Hidden type: "Custom", autoVisible: true, startOnEvents: [ "com.adobe.csxs.events.ApplicationActivate", ], }, ], } ``` -------------------------------- ### Path Module Example Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/node-modules.md Illustrates path manipulation using the `path` module. Join directory and file names, and extract file extension and base name. ```typescript import { fs, path } from "../lib/cep/node"; const dir = "/Users/username/Documents"; const file = "myfile.txt"; const fullPath = path.join(dir, file); const ext = path.extname(fullPath); // ".txt" const name = path.basename(fullPath, ext); // "myfile" ``` -------------------------------- ### isAppInstalledEx() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vulcan-interface.md Checks if a Creative Cloud application is installed on the machine. This method is part of the CEP 6.x API. ```APIDOC ## isAppInstalledEx() ### Description Check if a CC application is installed on the machine (CEP 6.x API). ### Method ```typescript isAppInstalledEx(productSAPCodeSpecifier: string): boolean ``` ### Parameters #### Path Parameters - **productSAPCodeSpecifier** (string) - Required - App specifier (e.g., "ILST-25.2.3") ### Returns True if app is installed, false otherwise. ### Example ```typescript const vulcan = new Vulcan(); if (vulcan.isAppInstalledEx('ILST-25.2.3')) { console.log('Illustrator 25.2.3 is installed'); } else if (vulcan.isAppInstalledEx('ILST-25')) { console.log('Some version of Illustrator 25 is installed'); } ``` ``` -------------------------------- ### Module Installation Configuration Schema Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/configuration.md Schema for specifying additional Node.js modules to bundle with the extension. ```typescript { installModules?: string[]; } ``` -------------------------------- ### Make HTTPS GET Request with HTTPS Module Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/node-modules.md Shows how to perform an HTTPS GET request to fetch data from a specified URL. The response data is logged to the console. ```typescript import { https } from "../lib/cep/node"; https.get('https://api.example.com/data', (res) => { res.on('data', (chunk) => { console.log(chunk); }); }); ``` -------------------------------- ### getAppPathEx() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vulcan-interface.md Retrieves the installation path of a Creative Cloud application. This method is part of the CEP 6.x API. ```APIDOC ## getAppPathEx() ### Description Get the installation path of a CC application (CEP 6.x API). ### Method ```typescript getAppPathEx(): string ``` ### Returns Full path to application directory, or empty string if not found. ### Example ```typescript const vulcan = new Vulcan(); const ppPath = vulcan.getAppPathEx(); if (ppPath) { console.log('App installed at:', ppPath); } ``` ``` -------------------------------- ### getSystemPath() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/csinterface-core.md Get a system path for a specific constant, such as the extension directory or host application path. ```APIDOC ## Method: getSystemPath(pathType: string) Get a system path for a specific constant. ### Signature ```typescript getSystemPath(pathType: string): string ``` ### Parameters #### Path Parameters - **pathType** (string) - Required - Constant from SystemPath (e.g., "extension", "hostApplication") ### Returns Full system path as string. ### Common Path Types - `"extension"`: Path to current extension directory - `"hostApplication"`: Path to host app executable - `"USER_DATA"`: User data directory - `"MY_DOCUMENTS"`: User documents directory ### Example ```typescript const extPath = csi.getSystemPath("extension"); const hostPath = csi.getSystemPath("hostApplication"); ``` ``` -------------------------------- ### Access Process Information using 'process' Module Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/node-modules.md Utilize the 'process' module to access environment variables and current working directory. This example demonstrates checking the platform and constructing a platform-specific directory path. ```typescript import { process } from "../lib/cep/node"; console.log(process.platform); // "darwin" console.log(process.env.HOME); // "/Users/username" const { platform, env } = process; const mainDir = platform === "darwin" ? `${env.HOME}/Library/Preferences` : env.APPDATA || ""; ``` -------------------------------- ### Create New Bolt CEP Project Source: https://github.com/hyperbrew/bolt-cep/blob/master/README.md Use these commands to create a new Bolt CEP project with your preferred package manager. Follow the CLI prompts for project setup. ```bash yarn create bolt-cep ``` ```bash npx create-bolt-cep ``` ```bash pnpm create bolt-cep ``` -------------------------------- ### Run in Development Mode (HMR) Source: https://github.com/hyperbrew/bolt-cep/blob/master/README.md Start the extension in Hot Module Replacement (HMR) mode for rapid development. Changes in JS and ExtendScript folders trigger automatic re-builds. Viewable in a browser at localhost:3000/panel/. ```bash yarn dev ``` ```bash npm run dev ``` ```bash pnpm dev ``` -------------------------------- ### Production ZXP Build Output Structure Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/project-structure.md This structure represents the output of a production ZXP build, typically generated using 'yarn zxp'. It contains the signed installer package for the CEP extension. ```bash dist/zxp/ └── com.bolt.cep.zxp # Signed installer package ``` -------------------------------- ### getAllLuts() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/adobe-host-utilities.md Discovers all available LUTs (Look-Up Tables) installed on the system, aggregating them from application, user, and global locations. The results are sorted alphabetically and returned without file extensions. ```APIDOC ## getAllLuts() ### Description Discovers all available LUTs (Look-Up Tables) installed on the system. It aggregates LUTs from application, user/local, and global search locations, sorts them alphabetically (case-insensitive), and returns filenames without extensions. ### Returns An object containing two arrays of LUT names: - `creative`: Array of creative LUT names. - `technical`: Array of technical LUT names. ### Example ```javascript import { getAllLuts } from '../lib/utils/ppro'; const { creative, technical } = getAllLuts(); console.log(creative); // ["ARRI K1S1", "ARRI K1S3", "DaVinci YRGB Color", "Log to Video"] console.log(technical); // ["ARRI LogC3", "ARRI LogC4", "Rec709", "S-Log3"] ``` ``` -------------------------------- ### Get OS Information using 'os' Module Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/node-modules.md Import and use the 'os' module to retrieve platform-specific information like the operating system type and user's home directory. This is useful for conditional logic based on the environment. ```typescript import { os } from "../lib/cep/node"; const isWindows = os.platform() === "win32"; const isMac = os.platform() === "darwin"; const homeDir = os.homedir(); if (isWindows) { console.log("Running on Windows"); } else if (isMac) { console.log("Running on macOS"); } ``` -------------------------------- ### Get Host Environment Information Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/csinterface-core.md Retrieves details about the host application, including its name, version, locale, and skin information. This is useful for adapting extension behavior based on the host environment. ```typescript import CSInterface from '../lib/cep/csinterface'; const csi = new CSInterface(); const host = csi.getHostEnvironment(); console.log(host.appName); // "After Effects" console.log(host.appVersion); // "24.0" ``` -------------------------------- ### File Selection Dialogs (TypeScript) Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/getting-started.md Utilizes utility functions `selectFile` and `selectFolder` for opening file or folder selection dialogs. Requires a starting path, a dialog title, and a callback function to handle the selected path. ```typescript import { selectFile, selectFolder } from '../lib/utils/bolt'; selectFile('/Users/username/Desktop', 'Choose image', (filePath) => { console.log('Selected:', filePath); }); selectFolder('/Users/username', 'Choose folder', (folderPath) => { console.log('Selected:', folderPath); }); ``` -------------------------------- ### initializeCEP() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/cep-utilities.md Sets up default CEP panel menus and event handlers, including flyout menu, context menu, and drag-drop prevention. ```APIDOC ## initializeCEP() ### Description Set up default CEP panel menus and event handlers. Called during Bolt initialization. ### Initializes: 1. Flyout menu with Refresh, info, and website items 2. Context menu with Reload and Force Reload options 3. Drop prevention to avoid navigation on drag-drop 4. (Optional) Keyboard event capture via `keyRegisterOverride()` ### Example ```typescript import { initBolt } from '../lib/utils/bolt'; // initializeCEP is called automatically via initBolt initBolt(); ``` ``` -------------------------------- ### Build Project for Distribution Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/INDEX.md Builds the project for distribution. This command prepares the project for deployment. ```bash npm run build ``` -------------------------------- ### Premiere Pro Host Utilities (`src/js/lib/utils/ppro.ts`) Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/project-structure.md Offers utilities for the Premiere Pro host environment, including discovering LUTs and accessing supported import file formats. ```APIDOC ## Premiere Pro Host Utilities (`src/js/lib/utils/ppro.ts`) ### Description This module contains utilities specifically designed for the Premiere Pro host application, facilitating interaction with Premiere Pro's features and file handling capabilities. ### Exports - `getAllLuts(): Promise>`: Discover all installed LUTs in Premiere Pro. - `allowedImportFiles`: An array listing the file formats supported for import in Premiere Pro. ``` -------------------------------- ### Check if Application is Installed Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vulcan-interface.md Verifies if a specific Adobe Creative Cloud application is installed on the machine. This method allows for checking exact versions or any version within a major release. ```typescript const vulcan = new Vulcan(); if (vulcan.isAppInstalledEx('ILST-25.2.3')) { console.log('Illustrator 25.2.3 is installed'); } else if (vulcan.isAppInstalledEx('ILST-25')) { console.log('Some version of Illustrator 25 is installed'); } ``` -------------------------------- ### getExtensionID() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/csinterface-core.md Get the unique identifier of the current extension. ```APIDOC ## Method: getExtensionID() Get the unique identifier of the current extension. ### Signature ```typescript getExtensionID(): string ``` ### Returns Extension ID as defined in cep.config.ts. ### Example ```typescript const extId = csi.getExtensionID(); console.log(extId); // "com.bolt.cep" ``` ``` -------------------------------- ### getApplicationID() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/csinterface-core.md Get the unique identifier of the host application. ```APIDOC ## Method: getApplicationID() Get the unique identifier of the host application. ### Signature ```typescript getApplicationID(): string ``` ### Returns Application ID (e.g., "AEFT", "PPRO", "PHXS"). ### Example ```typescript const appId = csi.getApplicationID(); console.log(appId); // "AEFT" for After Effects ``` ``` -------------------------------- ### launchApp() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vulcan-interface.md Launches a specified CC application using the legacy API. ```APIDOC ## launchApp() ### Description Launch a CC application (legacy API). ### Parameters #### Path Parameters - **targetSpecifier** (string) - Required - The identifier of the application to launch. - **focus** (boolean) - Required - Whether to bring the application to the foreground. - **cmdLine** (string) - Optional - Command line arguments to pass to the application. ### Returns boolean - True if the application was launched successfully, false otherwise. ### Note Use `launchAppEx()` for CEP 6.x and newer. ``` -------------------------------- ### initBolt() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/bolt-utilities.md Initialize the Bolt CEP environment. This function loads necessary ExtendScript files and sets up the core CEP initialization process. ```APIDOC ## initBolt(log) ### Description Initialize the Bolt CEP environment. Loads ExtendScript files and sets up CEP initialization. ### Parameters #### Path Parameters - **log** (boolean) - Optional - If true, logs initialization steps to console. Defaults to true. ### Request Example ```typescript import { initBolt } from '../lib/utils/bolt'; // Call once on app initialization initBolt(); ``` ``` -------------------------------- ### getScaleFactor() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/csinterface-core.md Gets the screen's scale factor, which is essential for DPI awareness on high-resolution displays. ```APIDOC ## getScaleFactor() ### Description Get the scale factor of the current screen (DPI awareness). ### Signature ```typescript getScaleFactor(): number ``` ### Returns - `-1.0` on error - `1.0` for normal screen - `>1.0` for HiDPI screens ### Example ```typescript const scale = csi.getScaleFactor(); if (scale > 1.5) { console.log('HiDPI screen detected'); } ``` ``` -------------------------------- ### Open Another Extension Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/csinterface-core.md Use `requestOpenExtension` to launch or bring another extension into focus. Provide the target extension's ID and any necessary startup parameters. ```typescript csi.requestOpenExtension('com.other.extension', ''); ``` -------------------------------- ### Build the Extension Source: https://github.com/hyperbrew/bolt-cep/blob/master/README.md Build the extension for static use or before running in development mode. This command creates a symlink to the extensions folder. ```bash yarn build ``` ```bash npm run build ``` ```bash pnpm build ``` -------------------------------- ### Open Folder Selection Dialog Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/bolt-utilities.md Launches a dialog for the user to select a folder. The callback receives the path of the chosen folder. ```typescript import { selectFolder } from '../lib/utils/bolt'; selectFolder('/Users/username/Desktop', 'Choose output folder', (folder) => { console.log('Selected:', folder); }); ``` -------------------------------- ### launchAppEx() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vulcan-interface.md Launches a Creative Cloud application on the local machine. This method is part of the CEP 6.x API. ```APIDOC ## launchAppEx() ### Description Launch a CC application on the local machine (CEP 6.x API). ### Method ```typescript launchAppEx( productSAPCodeSpecifier: string, focus: boolean, cmdLine?: string ): boolean ``` ### Parameters #### Path Parameters - **productSAPCodeSpecifier** (string) - Required - App specifier (e.g., "ILST-25.2.3", "ILST-25", "ILST") - **focus** (boolean) - Required - True to launch in foreground, false for background - **cmdLine** (string) - Optional - Command-line parameters ### Returns True if app was launched, false if already running or launch failed. ### Example ```typescript const vulcan = new Vulcan(); // Launch Illustrator 25.2.3 if (vulcan.launchAppEx('ILST-25.2.3', true)) { console.log('Illustrator launched'); } else { console.log('Illustrator already running or launch failed'); } // Launch with command line args vulcan.launchAppEx('PPRO-24.0', true, '--disable-unsupported-plugins'); ``` ``` -------------------------------- ### Get All Vulcan Endpoints Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vulcan-interface.md Retrieves all available endpoints for running Vulcan-enabled applications. Returns an array of endpoint XML strings. ```typescript const vulcan = new Vulcan(); const endpoints = vulcan.getEndPoints(); endpoints.forEach((endpoint) => { console.log('Available app:', endpoint); }); ``` -------------------------------- ### selectFolder() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/bolt-utilities.md Opens a folder selection dialog, allowing the user to choose a folder. The selected folder path is then passed to a callback function. ```APIDOC ## selectFolder() ### Description Opens a folder selection dialog and returns the selected folder path via a callback. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Method Signature ```typescript export const selectFolder = ( dir: string, msg: string, callback: (res: string) => void ) => void ``` ### Parameters - **dir** (string) - Required - Initial directory to open dialog in - **msg** (string) - Required - Dialog prompt message - **callback** (function) - Required - Called with selected folder path ### Example ```typescript import { selectFolder } from '../lib/utils/bolt'; selectFolder('/Users/username/Desktop', 'Choose output folder', (folder) => { console.log('Selected:', folder); }); ``` ``` -------------------------------- ### Initialize Bolt CEP Environment (TypeScript) Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/bolt-utilities.md Call `initBolt` once during application initialization to load ExtendScript files and set up the CEP environment. Optionally enable logging for initialization steps. ```typescript export const initBolt = (log = true) => void ``` ```typescript import { initBolt } from '../lib/utils/bolt'; // Call once on app initialization initBolt(); ``` -------------------------------- ### Get Current Extension Endpoint Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vulcan-interface.md Retrieves the endpoint XML string for the current extension. This is useful for self-identification within the Vulcan network. ```typescript const vulcan = new Vulcan(); const self = vulcan.getSelfEndPoint(); console.log('My endpoint:', self); ``` -------------------------------- ### Add Custom Ponyfills Source: https://github.com/hyperbrew/bolt-cep/blob/master/README.md Use `jsxPonyfill` in `vite.es.config.ts` to replace existing JavaScript functionality with custom methods. This example shows how to replace `Array.isArray`. ```javascript jsxPonyfill([ { find: "Array.isArray", replace: "__isArray", inject: `function __isArray(arr) { try { return arr instanceof Array; } catch (e) { return false; } };`, }, ]); ``` -------------------------------- ### Get Payload from Message Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vulcan-interface.md Extracts the payload from a received Vulcan message. The payload is typically a string that may need to be parsed (e.g., JSON). ```typescript getPayload(vulcanMessage: VulcanMessage): string ``` ```typescript vulcan.addMessageListener('com.myapp.data', (message) => { const payloadStr = vulcan.getPayload(message); const data = JSON.parse(payloadStr); console.log('Data:', data); }, this); ``` -------------------------------- ### Launch Application (Legacy) Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vulcan-interface.md Launches a CC application using the legacy API. Use `launchAppEx()` for CEP 6.x and newer. ```typescript launchApp(targetSpecifier: string, focus: boolean, cmdLine?: string): boolean ``` -------------------------------- ### join() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/adobe-host-utilities.md Join path segments into a single string using the appropriate OS-specific separator (`\` for Windows, `/` for macOS/Linux). ```APIDOC ## join() ### Description Join path segments with OS-appropriate separator. ### Method ```typescript export const join = (...args: string[]) => string ``` ### Parameters #### Path Parameters - **args** (string[]) - Required - Path segments to join ### Returns Joined path string. ### Behavior - Uses `\\` on Windows - Uses `/` on macOS/Linux ### Example ```typescript const path = join('Users', 'username', 'Documents', 'file.txt'); // macOS: "Users/username/Documents/file.txt" // Windows: "Users\username\Documents\file.txt" ``` ``` -------------------------------- ### Create Git Tag for ZXP Release Source: https://github.com/hyperbrew/bolt-cep/blob/master/README.md Create a git tag and push it to origin to trigger the GitHub Actions workflow for building and releasing a ZXP file. ```bash git tag 1.0.0 git push origin --tags ``` -------------------------------- ### Create Zip Archive Source: https://github.com/hyperbrew/bolt-cep/blob/master/README.md Bundle the packaged ZXP file and specified assets into a zip archive located in the `./zip` folder. ```bash yarn zip ``` ```bash npm run zip ``` ```bash pnpm zip ``` -------------------------------- ### Get Available Application Specifiers Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vulcan-interface.md Retrieves all available application SAP Code specifiers on the machine. Use this to discover which applications and versions are available for interaction. ```typescript import Vulcan from '../lib/cep/vulcan'; const vulcan = new Vulcan(); const apps = vulcan.getTargetSpecifiersEx(); console.log(apps); // ["ILST-25.2.3", "PPRO-24.0"] ``` -------------------------------- ### Create New Bolt CEP Extension Source: https://github.com/hyperbrew/bolt-cep/blob/master/create-bolt-cep/README.md Run this command to initiate the creation of a new CEP Extension project using the Bolt CEP boilerplate. ```bash yarn create bolt-cep ``` -------------------------------- ### requestOpenExtension() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/csinterface-core.md Launches or brings another extension to the foreground. This is useful for inter-extension communication or navigation. ```APIDOC ## requestOpenExtension() ### Description Launch or bring to focus another extension. ### Signature ```typescript requestOpenExtension(extensionId: string, startupParams: string): void ``` ### Parameters #### Parameters - **extensionId** (string) - Required - ID of extension to open - **startupParams** (string) - Required - Startup parameters (usually empty string) ### Example ```typescript csi.requestOpenExtension('com.other.extension', ''); ``` ``` -------------------------------- ### Define Custom Events (TypeScript) Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/getting-started.md Extends the `EventTS` type to define custom events for inter-panel communication or application events. Includes examples for `projectLoaded` and `renderProgress`. ```typescript export type EventTS = { projectLoaded: { projectName: string; itemCount: number; }; renderProgress: { current: number; total: number; percent: number; }; }; ``` -------------------------------- ### selectFile() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/bolt-utilities.md Opens a file selection dialog, allowing the user to choose a file. The selected file path is then passed to a callback function. ```APIDOC ## selectFile() ### Description Opens a file selection dialog and returns the selected file path via a callback. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Method Signature ```typescript export const selectFile = ( dir: string, msg: string, callback: (res: string) => void ) => void ``` ### Parameters - **dir** (string) - Required - Initial directory to open dialog in - **msg** (string) - Required - Dialog prompt message - **callback** (function) - Required - Called with selected file path ### Example ```typescript import { selectFile } from '../lib/utils/bolt'; selectFile('/Users/username/Desktop', 'Choose image', (file) => { console.log('Selected:', file); }); ``` ``` -------------------------------- ### Get Target Specifiers (Legacy) Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vulcan-interface.md Retrieves all available application specifiers using the legacy API. Use `getTargetSpecifiersEx()` for newer CE API with version info. ```typescript getTargetSpecifiers(): string[] ``` -------------------------------- ### Get Extension ID Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/csinterface-core.md Retrieves the unique identifier for the current extension, as defined in its configuration file. This is useful for logging or identifying the extension within the host application. ```typescript const extId = csi.getExtensionID(); console.log(extId); // "com.bolt.cep" ``` -------------------------------- ### Get After Effects Preferences Directory Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/adobe-host-utilities.md Retrieves the absolute file path to the After Effects preferences directory for the current application version. This is useful for accessing configuration files. ```typescript import { getPrefsDir } from '../lib/utils/aeft'; const prefsPath = getPrefsDir(); console.log(prefsPath); // macOS: "/Users/username/Library/Preferences/Adobe/After Effects/24.0" // Windows: "C:\\Users\\username\\AppData\\Roaming\\Adobe\\After Effects\\24.0" ``` -------------------------------- ### Get Screen Scale Factor Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/csinterface-core.md Use `getScaleFactor` to determine the screen's scale factor, which is essential for DPI awareness on HiDPI displays. Returns -1.0 on error. ```typescript const scale = csi.getScaleFactor(); if (scale > 1.5) { console.log('HiDPI screen detected'); } ``` -------------------------------- ### Create SHA256 Hash with Crypto Module Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/node-modules.md Demonstrates how to create a SHA256 hash of a string using the crypto module. Ensure the crypto module is imported correctly. ```typescript import { crypto } from "../lib/cep/node"; const hash = crypto.createHash('sha256'); hash.update('hello'); const digest = hash.digest('hex'); console.log(digest); ``` -------------------------------- ### evalFile() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/bolt-utilities.md Evaluate an ExtendScript file from disk. ```APIDOC ## `evalFile()` ### Description Evaluate an ExtendScript file from disk. ### Signature ```typescript export const evalFile = (file: string) => Promise ``` ### Parameters #### Path Parameters * None #### Query Parameters * None #### Request Body * None ### Parameters Table | Parameter | Type | Description | |-----------|------|-------------| | file | string | Path to the ExtendScript file to execute | ### Returns Promise resolving to the evaluation result. ### Example ```typescript import { evalFile } from '../lib/utils/bolt'; evalFile('/path/to/script.jsx').then((result) => { console.log('File executed:', result); }); ``` ``` -------------------------------- ### Get Application ID Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/csinterface-core.md Retrieves the unique identifier for the host application, such as "AEFT" for After Effects. This can be used to conditionally execute code specific to certain applications. ```typescript const appId = csi.getApplicationID(); console.log(appId); // "AEFT" for After Effects ``` -------------------------------- ### HTTP Module (`http`) Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/node-modules.md Enables making HTTP requests and creating HTTP servers. ```APIDOC ## http ### Description Enables making HTTP requests and creating HTTP servers. ### Common Methods - `http.get(url, callback)` - Make HTTP GET request - `http.request(options)` - Make HTTP request - `http.createServer()` - Create HTTP server ``` -------------------------------- ### Get Application Background Color (TypeScript) Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/bolt-utilities.md Retrieve the host application's background color using `getAppBackgroundColor`. Returns an object containing both RGB and hex color values. ```typescript export const getAppBackgroundColor = () => { rgb: { r: number; g: number; b: number }; hex: string; } ``` ```typescript import { getAppBackgroundColor } from '../lib/utils/bolt'; const color = getAppBackgroundColor(); console.log(color.hex); // "#3a3a3a" console.log(color.rgb); // { r: 58, g: 58, b: 58 } ``` -------------------------------- ### Host Utilities Imports (Premiere Pro) Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/INDEX.md Import Premiere Pro specific utility functions for host environment interaction. ```typescript // Premiere Pro import { getAllLuts, allowedImportFiles } from '../lib/utils/ppro'; ``` -------------------------------- ### getHostEnvironment() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/csinterface-core.md Retrieve information about the host application environment, including its name, version, locale, and skin information. ```APIDOC ## Method: getHostEnvironment() Retrieve information about the host application environment. ### Signature ```typescript getHostEnvironment(): HostEnvironment ``` ### Returns Object containing: - `appName` (string): Application name - `appVersion` (string): Application version - `appLocale` (string): Current license locale - `appUILocale` (string): Current UI locale - `appId` (string): Unique application identifier - `isAppOnline` (boolean): Whether application is online - `appSkinInfo` (AppSkinInfo): Color and font styling ### Example ```typescript import CSInterface from '../lib/cep/csinterface'; const csi = new CSInterface(); const host = csi.getHostEnvironment(); console.log(host.appName); // "After Effects" console.log(host.appVersion); // "24.0" ``` ``` -------------------------------- ### Get After Effects Output Modules Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/adobe-host-utilities.md Reads and parses After Effects output module names from the preferences. It filters out hidden modules and returns an array of available output module names. ```typescript import { getOutputModules } from '../lib/utils/aeft'; const modules = getOutputModules(); console.log(modules); // ["ProRes 422 HQ", "H.264", "PNG Sequence", "TIFF Sequence"] ``` -------------------------------- ### File System Access with CEP Node Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/INDEX.md Demonstrates how to access the file system using the `fs`, `path`, and `os` modules provided by CEP's Node.js environment. This allows reading and writing files, and path manipulation. ```typescript import { fs, path, os } from '../lib/cep/node'; const configPath = path.join(os.homedir(), '.myapp', 'config.json'); if (fs.existsSync(configPath)) { const config = JSON.parse(fs.readFileSync(configPath, 'utf-8')); } ``` -------------------------------- ### Get After Effects Render Settings List Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/adobe-host-utilities.md Reads and parses After Effects render settings names from the preferences. It filters out hidden settings and returns an array of available render setting names. ```typescript import { getRenderSettingsList } from '../lib/utils/aeft'; const settings = getRenderSettingsList(); console.log(settings); // ["Best Settings", "High Quality", "Draft Settings"] ``` -------------------------------- ### isAppRunning() Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/vulcan-interface.md Checks if a specified CC application is currently running using the legacy API. ```APIDOC ## isAppRunning() ### Description Check if application is running (legacy API). ### Parameters #### Path Parameters - **targetSpecifier** (string) - Required - The identifier of the application to check. ### Returns boolean - True if the application is running, false otherwise. ### Note Use `isAppRunningEx()` for CEP 6.x and newer. ``` -------------------------------- ### Package as Signed ZXP Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/INDEX.md Packages the project as a signed ZXP file, which is the standard format for CEP extensions. ```bash npm run zxp ``` -------------------------------- ### HostCapabilities Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/types.md Details the capabilities supported by the host application, such as menu customization and extension support. ```APIDOC ## HostCapabilities Capabilities supported by the host application. ### Properties - **EXTENDED_PANEL_MENU** (boolean) - Supports flyout menu customization - **EXTENDED_PANEL_ICONS** (boolean) - Supports custom panel icons - **DELEGATE_APE_ENGINE** (boolean) - Supports delegated APE engine - **SUPPORT_HTML_EXTENSIONS** (boolean) - Supports HTML/CEP extensions - **DISABLE_FLASH_EXTENSIONS** (boolean) - Flash extensions disabled ``` -------------------------------- ### Get Current CEP API Version Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/csinterface-core.md Use `getCurrentApiVersion` to retrieve the major, minor, and micro components of the current CEP API version. This is useful for feature detection based on API level. ```typescript const version = csi.getCurrentApiVersion(); if (parseFloat(version.major + '.' + version.minor) >= 11.2) { console.log('CEP 11.2 or newer'); } ``` -------------------------------- ### Operating System Module (`os`) Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/node-modules.md Provides information and utilities about the operating system, such as platform, home directory, CPU architecture, and more. ```APIDOC ## Operating System Module (`os`) ### Description Provides information and utilities about the operating system, such as platform, home directory, CPU architecture, and more. ### Methods - **`os.platform()`**: Returns the operating system platform (e.g., "win32", "darwin", "linux"). - **`os.homedir()`**: Returns the path to the current user's home directory. - **`os.tmpdir()`**: Returns the path to the default directory for temporary files. - **`os.arch()`**: Returns the CPU architecture (e.g., "x64", "arm64"). - **`os.cpus()`**: Returns an array of objects containing information about each CPU core. - **`os.type()`**: Returns the operating system type (e.g., "Windows_NT", "Darwin", "Linux"). ### Example ```typescript import { os } from "../lib/cep/node"; const isWindows = os.platform() === "win32"; const isMac = os.platform() === "darwin"; const homeDir = os.homedir(); if (isWindows) { console.log("Running on Windows"); } else if (isMac) { console.log("Running on macOS"); } ``` ``` -------------------------------- ### Parse and Format URLs Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/node-modules.md Demonstrates parsing a URL string into its components and accessing properties like hostname and query. Requires importing the 'url' module. ```typescript import { url } from "../lib/cep/node"; const parsed = url.parse('https://example.com/path?query=value'); console.log(parsed.hostname); // "example.com" console.log(parsed.query); // "query=value" ``` -------------------------------- ### ZIP Package Output Structure Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/project-structure.md This structure represents the output of a ZIP package build, typically generated using 'yarn zip'. It includes the ZXP file along with other assets, suitable for distribution or manual installation. ```bash zip/ └── bolt-cep-2.2.3.zip # ZXP + assets archive ``` -------------------------------- ### Explicitly Install Node.js Modules Source: https://github.com/hyperbrew/bolt-cep/blob/master/README.md If a Node.js module is missed by the build system, explicitly add it to the `installModules` array in your `cep.config.ts` file. Place requires inside functions for Node.js-specific modules to ensure they are only required at runtime. ```typescript installModules: ["unzipper"], ``` -------------------------------- ### CEP Input/Output Utilities (`src/js/lib/utils/cep.ts`) Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/project-structure.md Provides utilities for handling CEP-specific input and output operations, including keyboard event registration and text input patches. ```APIDOC ## CEP Input/Output Utilities (`src/js/lib/utils/cep.ts`) ### Description This module offers utilities for managing CEP-specific input and output functionalities, primarily focused on enhancing user interaction within the CEP environment. ### Exports - `keyRegisterOverride(keys: string, callback: Function): void`: Register custom keyboard event listeners. - `textCepPatch(): void`: Apply patches to fix text input behavior on macOS. - `dropDisable(): void`: Prevent the browser from navigating away when files are dragged and dropped. ``` -------------------------------- ### Get System Path Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/api-reference/csinterface-core.md Retrieves a system path based on a predefined constant, such as the extension's directory or the host application's executable path. Use this to access files or directories relative to the host or extension. ```typescript const extPath = csi.getSystemPath("extension"); const hostPath = csi.getSystemPath("hostApplication"); ``` -------------------------------- ### Robust Error Handling with try-catch and evalTS Source: https://github.com/hyperbrew/bolt-cep/blob/master/_autodocs/getting-started.md Implement robust error handling for potentially failing ExtendScript operations. This example uses a `try-catch` block to gracefully handle errors during the execution of a risky operation via `evalTS`. ```typescript try { const result = await evalTS('risky', 'operation'); console.log(result); } catch (error) { console.error('ExtendScript failed:', error.message); // Handle error gracefully } ```