Skip to main content

Ae App & Project

Here you'll find all blocks that do something with the After Effects application or the project, but are not specific to a particular project item or composition. This includes things like creating folders, importing footage or saving and closing projects, as well as executing Ae menu commands and storing values in Ae's settings.

Create Bin

Block ae_project_item_create_bin

This block creates a new bin in the project panel.

paths and sub-bins

Instead of the name of a bin like footage, you can also provide an entire path like footage/audio. In that case a bin footage is created (if it does not yet exist) and inside of it a bin audio (again, only if a sub-bin of that name does not yet exist).

parent bin

Here, you can enter the name or path of a parent bin, inside of which the bin should be created. Instead of entering a bin manually, you can select the bin in your project and then click the refresh button of the parent bin input.

Note that if you want to create a bin psd inside a bin footage, for example, you have two options:

  1. enter footage/psd as the bin path and leave the parent bin empty
  2. enter psdas the bin path and set the parent bin to `footage``

The only difference is that the first option creates the bin footage, if it does not yet exist, whereas the second option gives an error in that case.

example

This video shows some examples of how to use the Create Bin block:

Sync Folder

Block block_ae_sync_project_bin_with_folder

This block is your smart file importer. It syncs a bin in the project panel with a folder on your harddrive, i.e. it imports all files from that folder into the bin, but only if they haven't already been imported. This means whenever the contents of the folder changes, you can simply execute the block again to update the contents of the project.

sync folder is the folder on your hard-drive which should be imported.

with project bin is the bin in the project panel that the files of the given folder should be imported into. If the project bin does not exist, the block creates it for you.

subfolders can be set to

  • include: also creates for each subfolder a corresponding sub-bin, and syncs those too. So, the entire folder structure (including subfolders of subfolders) is recreated inside the project panel.
  • exclude: ignores all content of subfolders
  • flatten: imports files from subfolders directly into the main bin instead of creating sub-bins for them.

To set this value, you can either choose a value in the dropdown list or drag a text value on top of the dropdown. This text then must contain exactly one of the three words include, exclude, or flatten.

import multi-layer files as allows you to import those as footage, comp or comp (cropped layers). These are exactly the same options as those provided by Ae's normal import dialog. To set this value, you can either choose a value in the dropdown list or drag a text value on top of the dropdown. This text then must contain one of the three words footage, comp, or comp (cropped layers).

import numbered images as sequence enables the import of image sequences. If it is disabled, each image is imported as an individual project item. Note that images, which have no number at the end of their file name, are always imported as a single still image and not an image sequence of length 1. So, if you enable the image sequence option, a file myImage.png will still be imported as a still image, but an image myImage000.png or myImage004.png will be treated as part of an image sequence.

delete other items enables a check if the synced project bin in the project panel contains other items, which are not included in the folder on your hard-drive. Note that this option deletes all other items (also comps etc), to ensure that the contents of the folder and the synced project bin are 100% identical.

no live update

Note that when the contents of the folder on your harddrive changes, the project bin does not update instantly. You need to execute the block again, to apply all changes to the project bin.

Import File

Block block_ae_import_file

This block imports a single image, video, audio or Ae project file into the project.

Project Item Variable

The new project item is saved in the variable project item var, so you can use this variable if you want to do something with the imported item in subsequent blocks. In this example, I first import a footage file and then insert it as a new layer into the active composition:

Import file and insert it in the active composition

Parameters

project bin is the (name or path of) the bin in the project panel into which the file should be imported.

import multi-layer files as allows you to import them as footage, comp or comp (cropped layers). These are exactly the same options as those provided by Ae's normal import dialog.

import images as allows you to import images as still image or image sequence.

avoid duplicates checks if the footage item has already been imported into that project bin before. If this is the case, the block does not import the footage a second time and binds the variable project item var to the already existing project item instead.

Importing Many Files

If you want to import multiple files, consider using the Sync Folder block instead.

Current Project File

Block block_ae_project_file

This block returns the file path of the currently open project file. If the current project has not yet been saved, it gives an error. To check if a project file exists, use the block Has Project File.

Has Project File

Block block_ae__has_project_file

A logic value which false, if the currently open project has no project file yet (i.e. has not been saved at all yet).

Current Project Folder

Block block_ae_project_folder

This block returns the folder path of the folder which contains the currently open project. If the current project has not yet been saved, it gives an error. To check if a project file (and hence project folder) exists, use the block Has Project File.

Project Name

Block block_ae_project_name

This block returns the name of the project (i.e. the filename of the aep file) with or without the .aep extension.

If you need the full file path, use the block Current Project File instead.

Save Project

Block ae_project_save

This block saves the current project, exactly like the menu command File->Save.

Save Project As

Block ae_project_save_as

Saves the Ae project to a new file.

allow to overwrite if file exists: if you disable this option, the block gives an error if the file aready exists.

create folder if not existing: if this option is enabled, the block creates the folders of the given file path, if they don't yet exist.

Open Project

Block ae_project_open

Opens the given project file.

if current project has unsaved changes offers the choices don't save, save and prompt.

Close Project

Block ae_project_close

Closes the currently open Ae project.

if current project has unsaved changes offers the choices don't save, save and prompt.

New Project

Block ae_project_new

Creates a new, empty Ae project.

if current project has unsaved changes offers the choices don't save, save and prompt.

Execute Menu Command

Block ae_execute_menu_command

This block allows you to execute any command from the After Effects main menu. As an argument, you need to provide either the exact label of the menu entry, like Increment and Save or Open Team Project.... Be sure to write the exact text as it appears in the menu, including spaces, dots and use the correct upper/lower case.

Menu command using a label

Instead of using the label, you can also enter an After Effects menu command ID. David Torno has created a great description of what menu command IDs are, as well as a comprehensive list of them.

Support for other UI Languages

Note that the menu command names area different in each language. Save as... only works for English Ae, for example, whereas you need to use in the German version Speichern Unter... instead. To be compatible with After Effects installations in different languages, it's better to use the IDs instead of label names.

Get Settings

Block ae_settings_get

Retrieves a value that you stored in the settings using save settings.

Save Settings

Block ae_settings_save

Save any value (texts, numbers, lists,...) inside After Effects' settings. This allows you to remember values and retrieve them again when the script is executed the next time. You can even use it to share data between different scripts, if one script writes the settings and another reads the settings using the same key.

Key

The key is a unique name that you need to retrieve the value again. Make sure to use a descriptive name so it's unlikely it will overlap with other scripts. If you use a key like width, it is likely that another script is using the same key too. If you use width of Mathias' layer distribution tool, such an overlap is less likely.

Example

Settings can be very helpful to remember the values that a user has entered into a dialog, so we can use the exact same values as default values next time:

Here, we ask the user to enter a color value. When you run the script for the first time, the dialog shows `#00000` as default value. After the dialog is closed, the color entered by the number is saved as the preference `my script's color`. When you run the script the next time, this value is used as default value.

Technical details

After Effects only supports strings as settings data. However, Automation Blocks converts any value to JSON, before storing it in the preferences (and decodes it again while reading the settings). So, you can store any kind of data in the settings, including numbers, logic values and lists.

tip

These values aren't shared between versions of Ae; each new install brings new settings files, so these preferences won't carry over.

Internally, all saved settings are stored in the section "Settings_AutomationBlocks". You cannot use this block to change Ae's internal preferences.