# Scripts

Create and execute custom After Effects scripts in one click, from the new Scripts Library in Motion Studio.

## Scripts Library

This page stores all your created scripts:

<figure><img src="/files/Zd0qndlck7SM89QF4ZmX" alt=""><figcaption><p>Scripts Library</p></figcaption></figure>

Start by creating a script from the footer actions. This brings you to the Scripts Edit Page, which provides a built-in editor to write your script. For assistance with After Effects' scripting language and functions, open the "Snippets" window, where you can search, copy, and/or inject snippets straight into the editor. You can also cmd/ctrl+z to undo actions taken on this page.

<figure><img src="/files/a024UbT52wBzNitb7Y4F" alt=""><figcaption><p>Editing a New Script</p></figcaption></figure>

Rename and add notes to your script in the side-panel, to keep track of its purpose.

Once finished, you can "Return to Scripts" to see the new script in the Library.

There are a number of actions you can perform on a new Script:

* Export Script, so you can share it with colleagues or transfer it to a new machine
* Duplicate - duplicates a script so you can iterate on it without losing the original version
* Add to Mini - shows a list of all your Minis that you can add the script to, for execution within AE. We also show the current active mini (below, "Mini 1"), for ease of reference.
* Delete Script

<figure><img src="/files/hKxxxvEnbP6nIn7VrZPm" alt=""><figcaption><p>Script Context Menu Actions</p></figcaption></figure>

Once a script is created and added to a Mini, it will show up as a "Linked Mini" in the side panel. A script can be added to multiple Minis.

<figure><img src="/files/Vnzzo7phjmAEJi69A4lC" alt=""><figcaption><p>Script with a Linked Mini</p></figcaption></figure>

Here, you can "Unlink" the Mini, removing the script from the Mini. You can also click on the name of the Mini to navigate to the Mini itself and change how the Script shows up in the Mini panel:

<figure><img src="/files/xRrz8eAaYMOEWgVvKzIr" alt=""><figcaption><p>Script within a Mini</p></figcaption></figure>

You can change the name, icon, and color of the Script inside the Mini. By default, the Script is "Linked" to the Scripts page. Meaning - any changes you make to the script inside the Mini will be made on the Scripts page as well. Clicking the "edit" button will enable you to edit the script from the Scripts page. If you want to completely unlink the script from the Scripts Library, you can click the "unlink" button. This makes the Script a separate entity that can be edited directly within the Mini:

<figure><img src="/files/Qzd18wyuyROw3WvFcRyr" alt="" width="375"><figcaption><p>Editing an Unlinked Script within a Mini</p></figcaption></figure>

Once in an Active Mini, your script will show up in the Mini panel in AE, where you can one-click execute the script.&#x20;

<figure><img src="/files/WwOIxGaxfYDlaRJ2TxWi" alt="" width="326"><figcaption><p>Motion Mini Panel in AE</p></figcaption></figure>

#### Important Notes

* Changes made to Scripts are *immediately synced* to your Mini, so you can edit and test quickly
* Any errors caused by your script will be propagated to the UI
* Scripts are automatically wrapped in an "Undo Group", which allows you to undo the action of the script in AE. You can also add your own Undo Group in the Script, in which case it will override our default Undo Group.
* We provide an initial script called **animationCompare,** that gives an example of how one could write a script


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://motion-studio.mtmograph.com/libraries/scripts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
