### Item.addGuide() Source: https://ae-scripting.docsforadobe.dev/item/item Creates a new guide and adds it to the guides object of the Item. ```APIDOC ## POST Item.addGuide() ### Description Creates a new guide and adds it to the guides object of the Item. Added in After Effects 16.1 (CC 2019). ### Method POST ### Endpoint app.project.item(index).addGuide(orientationType, position) ### Parameters #### Path Parameters - **orientationType** (Integer) - Required - 0 for a horizontal guide, 1 for a vertical guide. - **position** (Integer) - Required - The X or Y coordinate position of the guide in pixels. ### Response #### Success Response (200) - **index** (Integer) - The index of the newly-created guide. ### Request Example app.project.activeItem.addGuide(1, 500); ``` -------------------------------- ### Examples of Accessing Properties Source: https://ae-scripting.docsforadobe.dev/print_page Examples demonstrating how to access effects, masks, and specific property values within After Effects layers. ```APIDOC #### Examples If a layer named "myLayer" has a Box Blur effect, you can retrieve the effect in any of the following ways: ``` myLayer.property("Effects").property("Box Blur"); myLayer.property("Effects").property("boxBlur"); myLayer.property("Effects").property("ADBE Box Blur"); ``` If a layer named "myLayer" has a mask named "Mask 1" you can retrieve it as follows: ``` myLayer.property("Masks").property("Mask1"); ``` To get a Bulge Center value from a Bulge effect, you can use either of the following: ``` myLayer.property("Effects").property("Bulge").property("Bulge Center"); myLayer.property("Effects").property("Bulge").property("bulgeCenter"); ``` ``` -------------------------------- ### RenderQueue.render() Source: https://ae-scripting.docsforadobe.dev/renderqueue/renderqueue Starts the rendering process for the project. ```APIDOC ## POST app.project.renderQueue.render() ### Description Starts the rendering process. This method does not return until the render process is complete. ``` -------------------------------- ### Start Rendering Process Source: https://ae-scripting.docsforadobe.dev/print_page Starts the rendering process, equivalent to clicking Render in the Render Queue panel. The method blocks until rendering is complete. Use `pauseRendering()` or `stopRendering()` from callbacks to control the process. ```javascript app.project.renderQueue.render() ``` -------------------------------- ### Example: Manipulating Items in a Folder Source: https://ae-scripting.docsforadobe.dev/print_page This example demonstrates how to access items within a folder, check their types, and remove items that are not selected. It also includes validation for the parent folder. ```APIDOC ## Example: Manipulating Items in a Folder ### Description This example gets the second item from the project and checks that it is a folder. It then removes from the folder any top-level item that is not currently selected. It also checks to make sure that, for each item in the folder, the parent is properly set to the correct folder. ### Code Example ```javascript var myFolder = app.project.item(2); if (!(myFolder instanceof FolderItem)) { alert("error: second item is not a folder"); } else { var numInFolder = myFolder.numItems; //Always run loops backwards when deleting things: for (var i = numInFolder; i >= 1; i--) { var curItem = myFolder.item(i); if (curItem.parentFolder !== myFolder) { alert("error within AE: the parentFolder is not set correctly"); } else { if (!curItem.selected) { //found an unselected solid. curItem.remove(); } } } } ``` ``` -------------------------------- ### Item.setGuide() Source: https://ae-scripting.docsforadobe.dev/item/item Modifies the position of an existing guide. ```APIDOC ## PUT Item.setGuide() ### Description Modifies the position of an existing guide. Added in After Effects 16.1 (CC 2019). ### Method PUT ### Endpoint app.project.item(index).setGuide(position, guideIndex) ### Parameters #### Path Parameters - **position** (Integer) - Required - The new X or Y coordinate position of the guide in pixels. - **guideIndex** (Integer) - Required - The index of the guide to be modified. ### Response #### Success Response (200) - **result** (Nothing) - Returns nothing. ### Request Example app.project.activeItem.setGuide(1200, 0); ``` -------------------------------- ### Example: Moving Compositions to a New Folder Source: https://ae-scripting.docsforadobe.dev/print_page This script demonstrates how to create a new folder and move all composition items into it by setting their parent folder. ```APIDOC ## Example: Moving Compositions to a New Folder ### Description This script creates a new FolderItem in the Project panel and moves compositions into it. ### Code Example ```javascript //create a new FolderItem in project, with name "comps" var compFolder = app.project.items.addFolder("comps"); //move all compositions into new folder by setting //compItem's parentFolder to "comps" folder for (var i = 1; i <= app.project.numItems; i++){ if (app.project.item(i) instanceof CompItem) { app.project.item(i).parentFolder = compFolder; } } ``` ``` -------------------------------- ### Access Guide Visibility State Source: https://ae-scripting.docsforadobe.dev/other/viewoptions Retrieves the current visibility state of guides in the active view. ```javascript app.activeViewer.views[0].options.guidesVisibility; ``` -------------------------------- ### Configure View Options Source: https://ae-scripting.docsforadobe.dev/other/viewoptions Enables checkerboards and locks guides for the active viewer. ```javascript var activeViewer = app.activeViewer; var viewOptions = activeViewer.views[0].options; viewOptions.checkerboards = true; viewOptions.guidesLocked = true; ``` -------------------------------- ### Setting Temporal Ease Source: https://ae-scripting.docsforadobe.dev/other/keyframeease Examples demonstrating how to use KeyframeEase objects to set temporal ease for spatial and temporal properties. ```APIDOC ## Setting Temporal Ease ### Example: Spatial Property (Position) This example sets the temporal ease for the 'Position' property of a layer. ```javascript var easeIn = new KeyframeEase(0.5, 50); var easeOut = new KeyframeEase(0.75, 85); var myPositionProperty = app.project.item(1).layer(1).property("Position"); myPositionProperty.setTemporalEaseAtKey(2, [easeIn], [easeOut]); ``` ### Example: Temporal Property (Scale) This example sets the temporal ease for the 'Scale' property, which can be 2D or 3D. ```javascript var easeIn = new KeyframeEase(0.5, 50); var easeOut = new KeyframeEase(0.75, 85); var myScaleProperty = app.project.item(1).layer(1).property("Scale") // For 2D or 3D properties, set ease for each dimension myScaleProperty.setTemporalEaseAtKey(2, [easeIn, easeIn, easeIn], [easeOut, easeOut, easeOut]); ``` ``` -------------------------------- ### Example: Set Dropdown Menu Parameters Source: https://ae-scripting.docsforadobe.dev/property/property Demonstrates how to set custom menu items for a Dropdown Menu Control, including a separator line. ```javascript var dropdownItems = [ "First Item", "Second Item", "(-", "Another Item", "Last Item" ]; var dropdownEffect = layer.property("ADBE Effect Parade").addProperty("ADBE Dropdown Control"); dropdownEffect.property(1).setPropertyParameters(dropdownItems); ``` -------------------------------- ### Execute Script File with Path Variants Source: https://ae-scripting.docsforadobe.dev/introduction/overview Examples of running script files using absolute paths, including handling paths with spaces. ```bash afterfx.exe -r c:\myDocuments\Scripts\yourAEScriptHere.jsx afterfx.exe -r "c:\myDocuments\Scripts\Script Name with Spaces.jsx" ``` -------------------------------- ### CompItem.renderer Source: https://ae-scripting.docsforadobe.dev/item/compitem Gets or sets the current rendering plug-in module for the composition. ```APIDOC ## CompItem.renderer ### Description The current rendering plug-in module to be used to render this composition, as set in the Advanced tab of the Composition Settings dialog box. Allowed values are the members of CompItem.renderers. ### Type String; read/write. ``` -------------------------------- ### ViewOptions Scripting API Source: https://ae-scripting.docsforadobe.dev/print_page Methods and properties for controlling guide and ruler visibility and behavior within After Effects. ```APIDOC ## ViewOptions API ### Description Provides access to guide and ruler settings within the After Effects interface. ### Properties - **guidesLocked** (boolean) - Controls if guides are locked. - **guidesSnap** (boolean) - Controls if snapping to guides is enabled. - **guidesVisibility** (boolean) - Controls the visibility of guides. - **rulers** (boolean) - Controls the visibility of rulers. ``` -------------------------------- ### TextDocument.startIndent Source: https://ae-scripting.docsforadobe.dev/print_page Gets or sets the start indent paragraph attribute for the Text layer. Affects all paragraphs. ```APIDOC ## TextDocument.startIndent ### Description The Text layer's paragraph start indent option. ### Method Read/Write ### Endpoint textDocument.startIndent ### Parameters #### Type Floating-point value; read/write. ### Warning This value reflects all paragraphs in the Text layer. If you change this value, it will set all paragraphs in the Text layer to the specified setting. If this attribute has a mixed value, it will be read as `undefined`. ### Note This functionality was added in After Effects 24.0 ``` -------------------------------- ### Get CharacterRange from ComposedLineRange Source: https://ae-scripting.docsforadobe.dev/print_page Returns a CharacterRange object initialized from the start and end character indices of a ComposedLineRange. This method will throw an exception if the range is invalid. The returned CharacterRange is independent of the ComposedLineRange. ```javascript var characterRange = composedLineRange.characterRange(); ``` -------------------------------- ### Get First Font Family Group - After Effects Scripting Source: https://ae-scripting.docsforadobe.dev/text/fontsobject This example demonstrates how to access the first font family group and retrieve the family name and style name of the first font within that group. Ensure the After Effects version supports this functionality. ```javascript // Getting the first available Font Family Group on the system var firstFontGroup = app.fonts.allFonts[0]; // Getting the first Style for that Font Family var firstFontFamilyName = firstFontGroup[0].familyName; var firstFamilyStyle = firstFontGroup[0].styleName; alert(firstFontFamilyName+" "+firstFamilyStyle); ``` -------------------------------- ### Start Watch Folder Process Source: https://ae-scripting.docsforadobe.dev/general/application Initiates a network rendering process by watching a specified folder. Requires a valid Folder object as input. ```javascript var theFolder = new Folder("c:/tool"); app.watchFolder(theFolder); ``` -------------------------------- ### Remove First Guide Source: https://ae-scripting.docsforadobe.dev/item/item Removes the first guide from the active item. Guide indexes will shift after removal. Requires After Effects 16.1+. ```javascript app.project.activeItem.removeGuide(0); ``` -------------------------------- ### app.activate() Source: https://ae-scripting.docsforadobe.dev/general/application Opens the application main window if it is minimized or iconified, and brings it to the front of the desktop. ```APIDOC ## app.activate() ### Description Opens the application main window if it is minimized or iconified, and brings it to the front of the desktop. ### Parameters None. ### Returns Nothing. ``` -------------------------------- ### Create New Project Source: https://ae-scripting.docsforadobe.dev/general/application Initializes a new project, optionally closing the current one first. Returns null if the user cancels the save prompt. ```javascript app.project.close(CloseOptions.DO_NOT_SAVE_CHANGES); app.newProject(); ``` -------------------------------- ### Access Guide Snap State Source: https://ae-scripting.docsforadobe.dev/other/viewoptions Retrieves the current snapping state for guides in the active view. ```javascript app.activeViewer.views[0].options.guidesSnap; ``` -------------------------------- ### Access Guide Lock State Source: https://ae-scripting.docsforadobe.dev/other/viewoptions Retrieves the current locked state of guides in the active view. ```javascript app.activeViewer.views[0].options.guidesLocked; ``` -------------------------------- ### Set Output Module Settings Source: https://ae-scripting.docsforadobe.dev/renderqueue/outputmodule Demonstrates applying settings to an output module, including copying settings between modules and defining custom crop or file path data. ```javascript // If you want to get the values in the number format, use // GetSettingsFormat.NUMBER_SETTABLE as an argument. var omItem1_settable_str = app.project.renderQueue.item(1).outputModule(1).getSettings( GetSettingsFormat.STRING_SETTABLE ); // Set output module item 1 of render queue item 2 with values that you get from // output module 1 of render queue item 1 app.project.renderQueue.item(2).outputModule(1).setSettings( omItem1_settable_str ); ``` ```javascript var crop_data = { "Crop": true, "Crop Bottom": 0, "Crop Left": 0, "Crop Right": 8, "Crop Top": 10 }; app.project.renderQueue.item(1).outputModule(3).setSettings( crop_data ); ``` ```javascript var om1 = app.project.renderQueue.item(1).outputModule(1); var file_name = File.decode( om1.file.name ); // Name contains special character, space? var new_dir = new Folder( "~/new_output" ); var new_path = new_dir.fsName; var new_data = { "Output File Info": { "Base Path": new_path, "Subfolder Path": "draft", "File Name": file_name } }; om1.setSettings( new_data ); ``` ```javascript var om1 = app.project.renderQueue.item(1).outputModule(1); // Name contains special character, such as space? var file_name = File.decode( om1.file.name ); var new_path = "/Users/myAccount/new_output"; var separator = "/"; if ($.os.indexOf("Mac") == -1) { new_path = "C:\Users\myAccount\new_output"; separator = "\\"; } var new_data = { "Output File Info": { "Full Flat Path": new_path + separator + file_name } }; om1.setSettings( new_data ); ``` -------------------------------- ### Application Activation and Commands Source: https://ae-scripting.docsforadobe.dev/print_page Methods for activating the application window and executing specific menu commands. ```APIDOC ## app.activate() ### Description Opens the application main window if it is minimized or iconified, and brings it to the front of the desktop. ### Parameters None. ### Returns Nothing. ## app.executeCommand(id) ### Description Menu Commands in the GUI application have an individual ID number, which can be used as the parameter for this method. For some functions not included in the API this is the only way to access them. The app.findMenuCommandId() method can be used to find the ID number for a command. These web sites have more information and lists of the known numbers: * https://www.provideocoalition.com/after-effects-menu-command-ids/ * https://hyperbrew.co/blog/after-effects-command-ids/ ### Parameters - **id** (Integer) - The ID number of the command. ### Returns None. ### Example ```javascript // calls the Convert to Bezier Path command app.executeCommand(4162); ``` ## app.findMenuCommandId(command) ### Description Finds the ID number for a given menu command. ### Parameters - **command** (String) - The name of the menu command. ### Returns Integer - The ID number of the menu command. ``` -------------------------------- ### Add Vertical Guide Source: https://ae-scripting.docsforadobe.dev/item/item Adds a vertical guide to the active item at a specified pixel position. Requires After Effects 16.1+. ```javascript app.project.activeItem.addGuide(1, 500); ``` -------------------------------- ### app.open() Source: https://ae-scripting.docsforadobe.dev/general/application Opens a specified project file. If no file is provided, the user is prompted to select one. Returns a Project object or null if the operation is cancelled. ```APIDOC ## POST /api/app/open ### Description Opens a project file. If no file is supplied, the method prompts the user to select a project file. ### Method POST ### Endpoint /api/app/open ### Parameters #### Request Body - **file** (Extendscript File) - Optional - Project file to open. ### Request Example ```json { "file": "../my_folder/my_test.aep" } ``` ### Response #### Success Response (200) - **Project** (object) - A new Project object for the specified project. - **null** - If the user cancels the Open dialog box. #### Response Example ```json { "project": { "file": "my_test.aep", "name": "my_test.aep" } } ``` ``` -------------------------------- ### Set Guide Position Source: https://ae-scripting.docsforadobe.dev/item/item Modifies the position of an existing guide in the active item. The orientation type cannot be changed. Requires After Effects 16.1+. ```javascript app.project.activeItem.setGuide(1200, 0); ``` -------------------------------- ### Add Composition Markers Source: https://ae-scripting.docsforadobe.dev/item/compitem Demonstrates creating a new project and composition, then adding markers to the composition using the markerProperty. ```javascript // comp.markerProperty allows you to add markers to a comp. // It has the same functionality as layer.property("Marker") var currentProj = app.newProject(); var comp = currentProj.items.addComp("mycomp", 1920, 1080, 1.0, 5, 29.97); var solidLayer = comp.layers.addSolid([1, 1, 1], "mylayer", 1920, 1080, 1.0); var compMarker = new MarkerValue("This is a comp marker!"); compMarker.duration = 1; var compMarker2 = new MarkerValue("Another comp marker!"); compMarker2.duration = 1; comp.markerProperty.setValueAtTime(1, compMarker); comp.markerProperty.setValueAtTime(3, compMarker2); ``` -------------------------------- ### Adding a Property to a Group (Invalid Example) Source: https://ae-scripting.docsforadobe.dev/property/propertygroup This example demonstrates an incorrect way to add properties, where adding a new property invalidates references to previously added ones. ```javascript var effectsProperty = layer.property("ADBE Effect Parade"); var slider = effectsProperty.addProperty("ADBE Slider Control"); var color = effectsProperty.addProperty("ADBE Color Control"); var sliderProperty = slider.property("ADBE Slider Control-0001"); // Object 'slider' is Invalid ``` -------------------------------- ### Adding a Property to a Group (Corrected Example) Source: https://ae-scripting.docsforadobe.dev/property/propertygroup This revised example shows the correct method for adding properties to a group by storing the index of the added property to maintain valid references. ```javascript var effectsProperty = layer.property("ADBE Effect Parade"); var slider = effectsProperty.addProperty("ADBE Slider Control"); var sliderIndex = slider.propertyIndex; // Store 'slider' effect index so it can be reused later var color = effectsProperty.addProperty("ADBE Color Control"); var sliderProperty = effectsProperty.property(sliderIndex).property("ADBE Slider Control-0001"); ``` -------------------------------- ### Get Character Script Information Source: https://ae-scripting.docsforadobe.dev/text/fontsobject Use this function to get an array of objects describing the number of characters and their assigned CTScript. The preferredCTScript parameter breaks ties if a character belongs to multiple scripts. ```javascript var scriptsV = app.fonts.getCTScriptForString("ABヂ", CTScript.CT_ROMAN_SCRIPT); var str = "[0] chars:" + scriptsV[0].chars + // 2 " ctScript:" + getEnumAsString(scriptsV[0].ctScript) + "\n[1] chars:" + scriptsV[1].chars + // 1 " ctScript:" + getEnumAsString(scriptsV[1].ctScript); alert(str); ``` -------------------------------- ### Create and Organize FolderItem Source: https://ae-scripting.docsforadobe.dev/print_page This script demonstrates how to create a new FolderItem in the Project panel and move existing compositions into it. ```APIDOC ## Create and Organize FolderItem ### Description This script creates a new FolderItem in the Project panel and moves compositions into it. ### Code Example ```javascript //create a new FolderItem in project, with name "comps" var compFolder = app.project.items.addFolder("comps"); //move all compositions into new folder by setting //comp Item's parentFolder to "comps" folder for (var i = 1; i <= app.project.numItems; i++) { if (app.project.item(i) instanceof CompItem) { app.project.item(i).parentFolder = compFolder; } } ``` ### Returns FolderItem object. ``` -------------------------------- ### Get All Output Module Settings Source: https://ae-scripting.docsforadobe.dev/renderqueue/outputmodule Retrieves all settings for a given Output Module. Use GetSettingsFormat.STRING to get string representations or GetSettingsFormat.NUMBER for numerical values. This functionality was added in After Effects 13.0 (CC 2014). ```javascript // Get object that contains the string version of all current output module setting // values of output module item 1 from render queue item 1. // To get the values in the number format, use GetSettingsFormat.NUMBER as an argument. var omItem1_all_str= app.project.renderQueue.item(1).outputModule(1).getSettings( GetSettingsFormat.STRING ); // Convert to JSON format so that it is human-readable. var omItem1_all_str_json = omItem1_all_str.toSource(); // Get object that contains string version of settable output module setting values // of output module item 1 from render queue item 1. // If you want to get the values in the number format, use // GetSettingsFormat.NUMBER_SETTABLE as an argument. var omItem1_settable_str = app.project.renderQueue.item(1).outputModule(1).getSettings( GetSettingsFormat.STRING_SETTABLE ); // Currently, the format setting in the output module is not settable, but it // is readable. The next line will tell you the current format of output module // item 1 from render queue item 1. var current_format = app.project.renderQueue.item(1).outputModule(1).getSettings(GetSettingsFormat.STRING).Format; // This line will tell you the output module file info. var current_omFileTempalte = app.project.renderQueue.item(1).outputModule(1).getSettings(GetSettingsFormat.STRING)("Output File Info")["File Template"]; ``` -------------------------------- ### OutputModule.getSettings() Source: https://ae-scripting.docsforadobe.dev/print_page Retrieves all settings for a given Output Module. Settings can be obtained in string or number format, and for all or only settable properties. ```APIDOC ## GET /api/renderQueue/item/{index}/outputModule/{index}/settings ### Description Gets all settings for a given Output Module. ### Method GET ### Endpoint `app.project.renderQueue.item(index).outputModule(index).getSettings(format)` ### Parameters #### Query Parameters - **format** (GetSettingsFormat) - Required - Specifies the format of the returned settings (e.g., STRING, NUMBER, STRING_SETTABLE, NUMBER_SETTABLE). ### Request Example ```javascript // Get object that contains the string version of all current output module setting values var omItem1_all_str = app.project.renderQueue.item(1).outputModule(1).getSettings(GetSettingsFormat.STRING); // Convert to JSON format so that it is human-readable. var omItem1_all_str_json = omItem1_all_str.toSource(); // Get object that contains string version of settable output module setting values var omItem1_settable_str = app.project.renderQueue.item(1).outputModule(1).getSettings(GetSettingsFormat.STRING_SETTABLE); // Get the current format setting var current_format = app.project.renderQueue.item(1).outputModule(1).getSettings(GetSettingsFormat.STRING).Format; // Get the output module file info var current_omFileTempalte = app.project.renderQueue.item(1).outputModule(1).getSettings(GetSettingsFormat.STRING)['Output File Info']['File Template']; ``` ### Response #### Success Response (200) - **settings** (Object) - An object containing the output module settings in the requested format. ``` -------------------------------- ### Item.removeGuide() Source: https://ae-scripting.docsforadobe.dev/item/item Removes an existing guide from the Item. ```APIDOC ## DELETE Item.removeGuide() ### Description Removes an existing guide based on its index inside the Item.guides object. Added in After Effects 16.1 (CC 2019). ### Method DELETE ### Endpoint app.project.item(index).removeGuide(guideIndex) ### Parameters #### Path Parameters - **guideIndex** (Integer) - Required - The index of the guide to be removed. ### Response #### Success Response (200) - **result** (Nothing) - Returns nothing. ### Request Example app.project.activeItem.removeGuide(0); ``` -------------------------------- ### OutputModule.getSettings() Source: https://ae-scripting.docsforadobe.dev/renderqueue/outputmodule Retrieves all settings for a given Output Module, available since After Effects 13.0. ```APIDOC ## METHOD app.project.renderQueue.item(index).outputModule(index).getSettings() ### Description Gets all settings for a given Output Module. This functionality was added in After Effects 13.0 (CC 2014). ### Request Example var omItem1_all_str = app.project.renderQueue.item(1).outputModule(1).getSettings(GetSettingsFormat.STRING); ### Response - **Returns** (Object) - An object containing the settings of the output module. ``` -------------------------------- ### app.watchFolder() Source: https://ae-scripting.docsforadobe.dev/general/application Initiates a network rendering process by watching a specified folder. ```APIDOC ## app.watchFolder() ### Description Starts a Watch Folder (network rendering) process pointed at a specified folder. ### Parameters #### Request Body - **folder_object_to_watch** (Extendscript Folder) - Required - The folder to watch. ### Request Example var theFolder = new Folder("c:/tool"); app.watchFolder(theFolder); ### Response - **Returns** (Nothing) ``` -------------------------------- ### AVLayer.guideLayer Source: https://ae-scripting.docsforadobe.dev/layer/avlayer Checks if the layer is designated as a guide layer. ```APIDOC ## AVLayer.guideLayer ### Description `true` if the layer is a guide layer. ### Type Boolean; read/write. ``` -------------------------------- ### Property.expression Source: https://ae-scripting.docsforadobe.dev/property/property Gets or sets the expression string for a property. ```APIDOC ## Property.expression ### Description The expression for the named property. Writeable only when canSetExpression for the named property is `true`. When you specify a value for this attribute, the string is evaluated. * If the string contains a valid expression, expressionEnabled becomes true. * If the string does not contain a valid expression, an error is generated, and expressionEnabled becomes `false`. * If you set the attribute to the empty string, expressionEnabled becomes `false`, but no error is generated. ### Type String; read/write if canSetExpression for the named property is `true`. ``` -------------------------------- ### Project.importFileWithDialog() Source: https://ae-scripting.docsforadobe.dev/general/project Displays the 'Import File' dialog box, allowing the user to select and import files interactively. ```APIDOC ## POST /api/project/importFileWithDialog ### Description Shows an 'Import File' dialog box, allowing the user to select files for import. This is equivalent to the 'File > Import > File' command. ### Method POST ### Endpoint `/api/project/importFileWithDialog` ### Parameters None. ### Request Example ```json {} ``` ### Response #### Success Response (200) - **items** (Array of Objects) - An array of Item objects created during the import process. Returns `null` if the user cancels the dialog. #### Response Example ```json { "items": [ { "id": 124, "name": "imported_image.png" }, { "id": 125, "name": "imported_video.mp4" } ] } ``` ``` -------------------------------- ### AVLayer.quality Source: https://ae-scripting.docsforadobe.dev/layer/avlayer Sets or gets the display quality of the layer. ```APIDOC ## AVLayer.quality ### Description The quality with which this layer is displayed. ### Type A `LayerQuality` enumerated value; read/write. One of: * `LayerQuality.BEST` * `LayerQuality.DRAFT` * `LayerQuality.WIREFRAME` ``` -------------------------------- ### Open a Project File in ExtendScript Source: https://ae-scripting.docsforadobe.dev/general/application Opens a specified project file. If the file does not exist, it prompts the user to select a file. Returns a Project object or null if the user cancels. ```javascript var my_file = new File("../my_folder/my_test.aep"); if (my_file.exists) { var new_project = app.open(my_file); if (new_project) { alert(new_project.file.name); } } ``` -------------------------------- ### AVLayer.blendingMode Source: https://ae-scripting.docsforadobe.dev/layer/avlayer Sets or gets the blending mode of the layer. ```APIDOC ## AVLayer.blendingMode `app.project.item(index).layer(index).blendingMode` ### Description The blending mode of the layer. ### Type A BlendingMode enumerated value; read/write. One of: * `BlendingMode.ADD` * `BlendingMode.ALPHA_ADD` * `BlendingMode.CLASSIC_COLOR_BURN` * `BlendingMode.CLASSIC_COLOR_DODGE` * `BlendingMode.CLASSIC_DIFFERENCE` * `BlendingMode.COLOR` * `BlendingMode.COLOR_BURN` * `BlendingMode.COLOR_DODGE` * `BlendingMode.DANCING_DISSOLVE` * `BlendingMode.DARKEN` * `BlendingMode.DARKER_COLOR` * `BlendingMode.DIFFERENCE` * `BlendingMode.DISSOLVE` * `BlendingMode.DIVIDE` * `BlendingMode.EXCLUSION` * `BlendingMode.HARD_LIGHT` * `BlendingMode.HARD_MIX` * `BlendingMode.HUE` * `BlendingMode.LIGHTEN` * `BlendingMode.LIGHTER_COLOR` * `BlendingMode.LINEAR_BURN` * `BlendingMode.LINEAR_DODGE` * `BlendingMode.LINEAR_LIGHT` * `BlendingMode.LUMINESCENT_PREMUL` * `BlendingMode.LUMINOSITY` * `BlendingMode.MULTIPLY` * `BlendingMode.NORMAL` * `BlendingMode.OVERLAY` * `BlendingMode.PIN_LIGHT` * `BlendingMode.SATURATION` * `BlendingMode.SCREEN` * `BlendingMode.SUBTRACT` * `BlendingMode.SILHOUETE_ALPHA` - note the mispelling of 'SILHOUETTE'! * `BlendingMode.SILHOUETTE_LUMA` * `BlendingMode.SOFT_LIGHT` * `BlendingMode.STENCIL_ALPHA` * `BlendingMode.STENCIL_LUMA` * `BlendingMode.SUBTRACT` * `BlendingMode.VIVID_LIGHT` ``` -------------------------------- ### Compare app.openFast() vs app.open() Performance in ExtendScript Source: https://ae-scripting.docsforadobe.dev/general/application Opens a project using app.openFast() and app.open() to compare their performance. This method is undocumented and may change. ```javascript var projectFile = new File("someFile.aep"); $.hiresTimer; app.openFast(projectFile); var fastEnd = $.hiresTimer / 1000; app.project.close(CloseOptions.DO_NOT_SAVE_CHANGES); $.hiresTimer; app.open(projectFile); var normalEnd = $.hiresTimer / 1000; app.project.close(CloseOptions.DO_NOT_SAVE_CHANGES); alert( "The difference is " + parseInt(normalEnd-fastEnd) + " ms" + "\n\nFast: " + fastEnd + " ms" + "\nNormal:" + normalEnd + " ms" ); ``` -------------------------------- ### Property.separationDimension Source: https://ae-scripting.docsforadobe.dev/property/property Gets the dimension number for a separated follower property. ```APIDOC ## Property.separationDimension ### Description For a separated follower, the dimension number it represents in the multidimensional leader. The first dimension starts at 0. ### Type Integer; read-only. ``` -------------------------------- ### app.newProject() Source: https://ae-scripting.docsforadobe.dev/general/application Creates a new project in After Effects. ```APIDOC ## app.newProject() ### Description Creates a new project in After Effects, replicating the File > New > New Project menu command. ### Returns A new Project object, or null if no new project is created. ``` -------------------------------- ### TextDocument.fillColor Source: https://ae-scripting.docsforadobe.dev/text/textdocument Gets or sets the fill color of the Text layer. ```APIDOC ## TextDocument.fillColor ### Description The Text layer's fill color. ### Type Color value; read/write. ``` -------------------------------- ### Access CompItem displayStartTime Source: https://ae-scripting.docsforadobe.dev/print_page Access the time set as the beginning of the composition in seconds. ```javascript app.project.item(index).displayStartTime ``` -------------------------------- ### Organizing Items into Folders Source: https://ae-scripting.docsforadobe.dev/item/itemcollection Create a new folder and move all existing compositions into it by updating their parentFolder attribute. ```javascript //create a new FolderItem in project, with name "comps" var compFolder = app.project.items.addFolder("comps"); //move all compositions into new folder by setting //comp Item's parentFolder to "comps" folder for (var i = 1; i <= app.project.numItems; i++) { if (app.project.item(i) instanceof CompItem) { app.project.item(i).parentFolder = compFolder; } } ``` -------------------------------- ### RenderQueueItem.outputModule() Source: https://ae-scripting.docsforadobe.dev/renderqueue/renderqueueitem Gets an output module with the specified index position. ```APIDOC ## GET /api/renderQueueItem/{index}/outputModule ### Description Gets an output module with the specified index position. ### Method GET ### Endpoint `/api/renderQueueItem/{index}/outputModule` ### Parameters #### Path Parameters - **index** (Integer) - Required - The index of the RenderQueueItem. #### Query Parameters - **outputModuleIndex** (Integer) - Required - The position index of the output module (in the range `[1..numOutputModules]`). ### Response #### Success Response (200) - **outputModule** (Object) - The requested OutputModule object. #### Response Example ```json { "outputModule": { "name": "Output Module 1", "format": "QuickTime" } } ``` ``` -------------------------------- ### AVLayer.collapseTransformation Source: https://ae-scripting.docsforadobe.dev/layer/avlayer Gets or sets the state of the collapse transformation for the layer. ```APIDOC ## AVLayer.collapseTransformation `app.project.item(index).layer(index).collapseTransformation` ### Description `true` if collapse transformation is on for this layer. ### Type Boolean; read/write. ``` -------------------------------- ### Examples of Scripting in After Effects Source: https://ae-scripting.docsforadobe.dev/print_page Demonstrates common scripting tasks in After Effects, such as creating compositions, text layers, and animating text properties like font weight. ```APIDOC ## Examples ```javascript // Create a comp var comp = app.project.items.addComp("Create Axis Comp", 1920, 1080, 1, 30, 30); comp.openInViewer(); // Create a text layer var textLayer = comp.layers.addText("Hello World!"); // Set the font to variable font var textDocument = textLayer.property("Source Text").value; textDocument.font = 'ShantellSans'; // Must be a variable font textLayer.property("Source Text").setValue(textDocument); // Get the text property and animators group var textProp = textLayer.property("Text"); var animators = textProp.property("Animators"); // Add a new animator var animator = animators.addProperty("ADBE Text Animator"); var animatorProps = animator.property("ADBE Text Animator Properties"); // Add the Weight axis var axisProp = animatorProps.addVariableFontAxis("wght"); // Set a static value axisProp.setValue(700); // Set keyframes axisProp.setValueAtTime(0, 300); // Light at 0 seconds axisProp.setValueAtTime(2, 900); // Heavy at 2 seconds ``` ``` -------------------------------- ### CompItem.getMotionGraphicsTemplateControllerName Source: https://ae-scripting.docsforadobe.dev/print_page Gets the name of a single property in the Essential Graphics panel. ```APIDOC ## CompItem.getMotionGraphicsTemplateControllerName ### Description Gets the name of a single property in the Essential Graphics panel. ### Parameters #### Request Body - **index** (Integer) - Required - The index of the EGP property whose name will be returned. ### Response #### Success Response (200) - **name** (String) - The name of the property. ``` -------------------------------- ### Project.newTeamProject() Source: https://ae-scripting.docsforadobe.dev/print_page Creates a new team project. ```APIDOC ## Project.newTeamProject() ### Description Creates a new team project. Added in After Effects 14.2. ### Parameters #### Path Parameters - **teamProjectName** (String) - Required - Team project name - **description** (String) - Optional - Project description ### Response #### Success Response (200) - **Returns** (Boolean) - true if the team project is successfully created, otherwise false. ``` -------------------------------- ### Project.showWindow Source: https://ae-scripting.docsforadobe.dev/general/project Shows or hides the Project panel in After Effects. ```APIDOC ## Project.showWindow ### Description Shows or hides the Project panel. ### Parameters #### Path Parameters - **doShow** (Boolean) - Required - When true, show the Project panel. When false, hide the Project panel. ### Response #### Success Response (200) - **Returns** (Nothing) - No return value. ``` -------------------------------- ### Property.keyInInterpolationType() Source: https://ae-scripting.docsforadobe.dev/property/property Gets the 'in' interpolation type for a specific keyframe on a property. ```APIDOC ## Property.keyInInterpolationType() ### Description Returns the 'in' interpolation type for the specified keyframe. ### Parameters #### Path Parameters - **keyIndex** (Integer) - Required - The index for the keyframe, as returned by the addKey or nearestKeyIndex. The range is `[1..numKeys]`. ### Returns A `KeyframeInterpolationType` enumerated value; one of: * `KeyframeInterpolationType.LINEAR` * `KeyframeInterpolationType.BEZIER` * `KeyframeInterpolationType.HOLD` ``` -------------------------------- ### Create 360 VR Composition Source: https://ae-scripting.docsforadobe.dev/print_page Creates a new composition from a selected footage item, applies the CC Environment effect, and sets the camera tool. ```javascript // Create a 360 VR comp from a footage item or comp selected in the Project panel. var item = app.project.activeItem; if (item !== null && (item.typeName === "Footage" || item.typeName === "Composition")) { // Create a comp with the footage. var comp = app.project.items.addComp(item.name, item.width, item.height, item.pixelAspect, item.duration, item.frameRate); var layers = comp.layers; var footageLayer = layers.add(item); // Apply the CC Environment effect and create a camera. var effect = footageLayer.Effects.addProperty("CC Environment"); var camera = layers.addCamera("360 Camera", [item.width / 2, item.height / 2]); comp.openInViewer(); app.project.toolType = ToolType.Tool_CameraMaya; } else { alert("Select a single footage item or composition in the Project panel."); } ``` -------------------------------- ### Create New Team Project Source: https://ae-scripting.docsforadobe.dev/general/project Initializes a new team project. Requires After Effects 14.2 or later. ```javascript app.project.newTeamProject(teamProjectName, description) ``` -------------------------------- ### Retrieving Marker Values Source: https://ae-scripting.docsforadobe.dev/other/markervalue Examples of how to retrieve comment values from existing markers on a layer. ```APIDOC ## Retrieving Marker Values ### Description Examples demonstrating how to access and retrieve comment values from markers associated with a layer. ### Request Example ```javascript var layer = app.project.item(1).layer(1); var markerProperty = layer.marker; // Get comment of the first marker by index var commentOfFirstMarker = markerProperty.keyValue(1).comment; // Get comment of the marker at a specific time (time, whether to search inclusively) var commentOfMarkerAtTime4 = markerProperty.valueAtTime(4.0, true).comment; // Get comment of the marker closest to a specific time var markerValueAtTimeClosestToTime4 = markerProperty.keyValue(markerProperty.nearestKeyIndex(4.0)); var commentOfMarkerClosestToTime4 = markerValueAtTimeClosestToTime4.comment; ``` ``` -------------------------------- ### TextDocument.spaceBefore Source: https://ae-scripting.docsforadobe.dev/print_page Gets or sets the space before paragraph attribute for the Text layer. Affects all paragraphs. ```APIDOC ## TextDocument.spaceBefore ### Description The Text layer's paragraph space before option. ### Method Read/Write ### Endpoint textDocument.spaceBefore ### Parameters #### Type Floating-point value; read/write. ### Warning This value reflects all paragraphs in the Text layer. If you change this value, it will set all paragraphs in the Text layer to the specified setting. If this attribute has a mixed value, it will be read as `undefined`. ### Note This functionality was added in After Effects 24.0 ``` -------------------------------- ### System.callSystem() Method Source: https://ae-scripting.docsforadobe.dev/general/system Executes a system command and returns its output. ```APIDOC ## System.callSystem() ### Description Executes a system command, as if you had typed it on the operating system's command line. Returns whatever the system outputs in response to the command, if anything. In Windows, you can invoke commands using the `/c` switch for the `cmd.exe` command, passing the command to run in escaped quotes (`\"...\"`). For example, the following retrieves the current time and displays it to the user: ```javascript var timeStr = system.callSystem("cmd.exe /c \"time /t\""); alert("Current time is " + timeStr); ``` ### Method `system.callSystem(cmdLineToExecute);` ### Parameters #### Path Parameters - **cmdLineToExecute** (String) - Required - The command and its parameters. ### Returns The output from the command. ``` -------------------------------- ### app.openFast() Source: https://ae-scripting.docsforadobe.dev/general/application Opens a project file faster than app.open() by skipping some checks. This method is undocumented and may be subject to change. ```APIDOC ## POST /api/app/openFast ### Description Opens a project faster than `app.open()` by skipping some checks. This method is officially undocumented and may be inaccurate or disappear in future versions. ### Method POST ### Endpoint /api/app/openFast ### Parameters #### Request Body - **file** (Extendscript File) - Required - Project file to open. ### Request Example ```json { "file": "someFile.aep" } ``` ### Response #### Success Response (200) - **Project** (object) - A new Project object for the specified project. #### Response Example ```json { "project": { "file": "someFile.aep", "name": "someFile.aep" } } ``` ``` -------------------------------- ### TextDocument.spaceAfter Source: https://ae-scripting.docsforadobe.dev/print_page Gets or sets the space after paragraph attribute for the Text layer. Affects all paragraphs. ```APIDOC ## TextDocument.spaceAfter ### Description The Text layer's paragraph space after option. ### Method Read/Write ### Endpoint textDocument.spaceAfter ### Parameters #### Type Floating-point value; read/write. ### Warning This value reflects all paragraphs in the Text layer. If you change this value, it will set all paragraphs in the Text layer to the specified setting. If this attribute has a mixed value, it will be read as `undefined`. ### Note This functionality was added in After Effects 24.0 ``` -------------------------------- ### Access Font Object Attributes Source: https://ae-scripting.docsforadobe.dev/text/fontobject Examples of accessing various read-only attributes of the Font object. ```javascript app.fonts.allFonts[0][0].designAxesData ``` ```javascript app.fonts.fontsWithDefaultDesignAxes[0].designVector ``` ```javascript app.fonts.allFonts[0][0].familyName ``` ```javascript app.fonts.fontsWithDefaultDesignAxes[0].familyPrefix ``` ```javascript app.fonts.allFonts[0][0].fontID ``` ```javascript app.fonts.allFonts[0][0].fullName ``` ```javascript app.fonts.allFonts[0][0].hasDesignAxes ``` ```javascript app.fonts.allFonts[0][0].isFromAdobeFonts ``` ```javascript app.fonts.allFonts[0][0].isSubstitute ``` ```javascript app.fonts.allFonts[0][0].location ``` ```javascript app.fonts.allFonts[0][0].nativeFamilyName ``` ```javascript app.fonts.allFonts[0][0].nativeFullName ``` ```javascript app.fonts.allFonts[0][0].nativeStyleName ``` -------------------------------- ### Project.importFile() Source: https://ae-scripting.docsforadobe.dev/general/project Imports a specified file into the project using the provided ImportOptions. This is equivalent to the 'File > Import File' command. ```APIDOC ## POST /api/project/importFile ### Description Imports the file specified in the provided ImportOptions object, using the specified options. This is equivalent to the 'File > Import File' command. It creates and returns a new FootageItem object and adds it to the project's items array. ### Method POST ### Endpoint `/api/project/importFile` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **importOptions** (Object) - Required - Options specifying the file to import and the options for the operation. This object should contain details like the file path and import settings. ### Request Example ```json { "importOptions": { "file": "path/to/your/sample.psd", "forceConformToWorld": true } } ``` ### Response #### Success Response (200) - **footageItem** (Object) - The newly created FootageItem object representing the imported file. #### Response Example ```json { "footageItem": { "id": 123, "name": "sample.psd", "width": 1920, "height": 1080 } } ``` ``` -------------------------------- ### Get Current Working Gamma Source: https://ae-scripting.docsforadobe.dev/general/project Retrieves the current project's working gamma value. ```javascript var currentGamma = app.project.workingGamma; ``` -------------------------------- ### Import File with ImportOptions Source: https://ae-scripting.docsforadobe.dev/general/project Imports a file into the project using the specified ImportOptions. This is equivalent to the File > Import File command. ```javascript app.project.importFile(new ImportOptions(new File("sample.psd"))); ``` -------------------------------- ### app.newProject() Source: https://ae-scripting.docsforadobe.dev/print_page Creates a new project in After Effects. It replicates the File > New > New Project menu command and handles saving the current project if modified. ```APIDOC ## POST app.newProject ### Description Creates a new project in After Effects, replicating the File > New > New Project menu command. If the current project has been edited, the user is prompted to save it. If the user cancels out of the Save dialog box, the new project is not created and the method returns `null`. Use `app.project.close(CloseOptions.DO_NOT_SAVE_CHANGES)` to close the current project before opening a new one. ### Method POST ### Endpoint app.newProject() ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript app.project.close(CloseOptions.DO_NOT_SAVE_CHANGES); app.newProject(); ``` ### Response #### Success Response (200) - **Project object** - A new Project object. - **null** - If no new project is created (e.g., user cancels save). #### Response Example ```json { "project": "newProjectObject" } ``` ```