Skip to content

Folder

FolderItem

Bases: Item

The FolderItem object corresponds to a folder in your Project panel. It can contain various types of items (footage, compositions, solids) as well as other folders.

Example
from py_aep import parse

app = parse("project.aep")
root = app.project.root_folder
print(root.name)
for item in root:
    ...

See: https://ae-scripting.docsforadobe.dev/item/folderitem/

Attributes

comment

comment: str

The item comment. Read / Write.

guides

guides: list[Guide]

The item's ruler guides. Each guide has an orientation and a pixel position. Read-only.

id

id = ChunkField[int](
    "_idta", "item_id", read_only=True, default=0
)

The item unique identifier. Read-only.

items

items: list[Item] = []

The items in this folder. Contains only the top-level items in the folder. Read-only.

label

label = enum(Label, '_idta', 'label', default=NONE)

The label color. Colors are represented by their number (0 for None, or 1 to 16 for one of the preset colors in the Labels preferences). Read / Write.

name

name = ChunkField[str](
    "_name_utf8", "value", validate=validate_name
)

The name of the item, as shown in the Project panel. Read / Write.

num_items

num_items: int

Return the number of items in the folder.

Note

Equivalent to len(folder.items)

parent_folder

parent_folder: FolderItem | None

The parent folder of this item. None for the root folder. Read-only.

selected

selected: bool

When True, this item is selected. Read-only.

Note

Item selection is not stored in the .aep binary format; it is a runtime-only state. Parsed projects always report False.

type_name

type_name: str

A user-readable name for the item type ("Folder", "Footage" or "Composition"). These names are application locale-dependent, meaning that they are different depending on the application's UI language. Read-only.

Functions

add_comp

add_comp(
    name: str | None,
    width: int,
    height: int,
    pixel_aspect: float,
    duration: float,
    frame_rate: float,
) -> CompItem

Create a new composition inside this folder.

Parameters:

  • name (str | None) –

    The name of the new composition. Pass None to auto-generate a name (Comp 1, Comp 2, ...). An empty string is allowed.

  • width (int) –

    The width of the composition in pixels.

  • height (int) –

    The height of the composition in pixels.

  • pixel_aspect (float) –

    The pixel aspect ratio (1.0 for square pixels).

  • duration (float) –

    The duration in seconds.

  • frame_rate (float) –

    The frame rate in frames per second.

Returns:

add_folder

add_folder(name: str | None = None) -> FolderItem

Create a new folder inside this folder.

Parameters:

  • name (str | None, default: None ) –

    The name of the new folder. Pass None to auto-generate a name (Untitled 1, Untitled 2, ...). An empty string is allowed.

Returns:

add_guide

add_guide(orientation_type: int, position: int) -> int

Adds a new guide to the item.

Any orientation_type value other than 0 (horizontal) or 1 (vertical) defaults to horizontal.

Parameters:

  • orientation_type (int) –

    0 for horizontal, 1 for vertical.

  • position (int) –

    The pixel position of the guide.

Returns:

  • int

    The index of the new guide.

remove

remove() -> None

Remove this folder and all its children from the project.

remove_guide

remove_guide(guide_index: int) -> None

Removes an existing guide by index.

Parameters:

  • guide_index (int) –

    The 0-based index of the guide to remove.

Raises: