# Run After Effects Batch Scripts on a Rented Mac

Canonical: https://figment.so/blog/mac-after-effects-script-batch-render

Collect your project, run aerender from a script that parses its log for failures, and detach it with nohup. For GPU-accelerated effects, test your own project in the first days of a month on the Dedicated M4 Pro 48 GB ($349, cancel any time).

**Collect the project with File → Dependencies → Collect Files, move it to the rented Mac, and run `aerender` from a script that parses its log for failures, because aerender can exit 0 even when it logged errors.** That moves an overnight render off your workstation. Adobe's aerender flags used below are documented at [helpx.adobe.com: Automated rendering and network rendering](https://helpx.adobe.com/after-effects/desktop/render-and-export/automate-rendering/automated-rendering-network-rendering.html). Confirm them against `aerender -help` on the exact After Effects build installed on the rental.

## What does aerender do that the GUI Render Queue does not?

`aerender` is the command-line tool that ships with After Effects. It launches a headless AE instance and processes queue items or named compositions from a project file, so a shell script can drive it, log to a file, and run from a terminal you then disconnect from.

The GUI Render Queue is not single-item either. Once you click Render it processes every queued output in order within one session. What aerender adds is scripted invocation, a clean exit from a shell, a parseable text log, and no modal dialogs blocking progress. For a two-hour overnight batch those are what matter.

| Feature | GUI Render Queue | aerender CLI |
|---|---|---|
| Requires open AE window | Yes | No |
| Multi-composition queue in one session | Yes, processes all queued items in order | Yes, same project queue |
| Scriptable in shell pipelines | No | Yes |
| Parseable text log | Partial (Info panel) | Yes, via `-log` or stdout |
| Suited to unattended / overnight runs | Fragile (GUI focus, dialogs) | Yes |

The binary sits beside the AE application, and the folder name tracks the installed year:

```bash
/Applications/Adobe\ After\ Effects\ 2024/aerender
```

Run `aerender -help` on the rental first. Flag names and defaults change between AE versions, and the installed year on the rental may not match your workstation.

## How do I prepare the project for a headless render?

Run **File → Dependencies → Collect Files** in After Effects before uploading. This copies the project and every referenced asset into one folder with relative paths that resolve on another machine. Skip it and aerender either stops on missing footage (the default) or, with `-continueOnMissingFootage`, renders placeholder colour bars where your footage should be. Neither is a client deliverable.

Pre-flight checklist:

- [ ] Run Collect Files. Leave "Reduce Project" off if you need every comp.
- [ ] Open the collected copy once on your workstation and confirm the render queue items point at relative paths inside the collected folder.
- [ ] Confirm that every Output Module and Render Settings template referenced by your queue exists in the collected project. These templates can live in the workstation's AE preferences rather than inside the project, so a queue that renders fine locally can break on a fresh install. If in doubt, re-save a fresh built-in template inside the project.
- [ ] Confirm every third-party plug-in is licensed on the rented Mac. Plug-in licensing is separate from the Creative Cloud subscription.
- [ ] Remove queue items you do not want rendered, or note their indices for `-rqindex`.

Move the collected folder to the rental with `scp` or `rsync` over SSH, or through a cloud location you sign in to on the rental itself (Dropbox, Drive or an S3 bucket you own).

## What does the aerender batch script look like?

Install `jq` first, because macOS does not include it. This untested script renders every item already in the project's render queue, writes a log, parses the log for Adobe's known failure markers, and posts one Slack notification. Treat it as a starting point and dry-run it against a small test project before you trust it on client work.

```bash
#!/usr/bin/env bash
# aerender-batch.sh - verify on your rental before scheduling.
set -euo pipefail

AE_VERSION="${AE_VERSION:-2024}"
AERENDER="/Applications/Adobe After Effects ${AE_VERSION}/aerender"
PROJECT_PATH="${PROJECT_PATH:?set PROJECT_PATH to your .aep}"
LOG_DIR="${LOG_DIR:-$HOME/ae-logs}"
WEBHOOK_FILE="${WEBHOOK_FILE:-$HOME/.slack_webhook}"

mkdir -p "$LOG_DIR"
LOG_FILE="$LOG_DIR/render_$(date +%Y%m%d_%H%M%S).log"
HOST_SHORT="$(hostname -s)"

notify() {
  local msg="$1"
  [[ -r "$WEBHOOK_FILE" ]] || { echo "notify: no webhook file" >&2; return 0; }
  local url body
  url="$(cat "$WEBHOOK_FILE")"
  # Build JSON with jq so a hostname containing quotes or backslashes
  # can never produce a malformed body.
  body="$(jq -nc --arg t "$msg" '{text:$t}')" \
    || { echo "notify: JSON creation failed" >&2; return 0; }
  # --fail returns non-zero on HTTP errors; --max-time bounds the call so
  # a slow Slack never stalls the finished render.
  curl --fail --silent --show-error --max-time 10 \
       -H 'Content-type: application/json' \
       -X POST -d "$body" "$url" >/dev/null \
    || echo "notify: slack post failed, continuing" >&2
}

echo "=== aerender start $(date -u +%FT%TZ) on ${HOST_SHORT} ===" | tee "$LOG_FILE"
notify "AE batch started on ${HOST_SHORT}"

# Default behaviour: fail on missing footage. Opt in to placeholders only
# when color bars for missing assets are genuinely acceptable.
set +e
"$AERENDER" -project "$PROJECT_PATH" >>"$LOG_FILE" 2>&1
AE_RC=$?
set -e

# aerender has historically returned 0 even after logging failures.
# Treat the log as the source of truth.
if grep -Eq 'aerender ERROR|Failed to render|Could not find source file|rendering stopped' "$LOG_FILE"; then
  notify "AE batch FAILED on ${HOST_SHORT} - see ${LOG_FILE}"
  exit 1
fi
if [[ "$AE_RC" -ne 0 ]]; then
  notify "AE batch exited ${AE_RC} on ${HOST_SHORT}"
  exit "$AE_RC"
fi

notify "AE batch exited without detected errors on ${HOST_SHORT}; inspect outputs before delivery."
```

Flag notes, cross-checked against Adobe's aerender reference linked above:

- With no `-comp` and no `-rqindex`, aerender renders every item already in the project's render queue in order.
- `-continueOnMissingFootage` is **omitted by default** in this script. That is intentional: a missing asset should stop the batch and surface in the log rather than ship as placeholder colour bars. Add the flag only when you want placeholder output.
- `-comp "Main_1080p" -output "$HOME/out/Main_[####].png"` renders a single named composition. `-rqindex 1` targets a specific queue entry.
- `-s` and `-e` override start and end frames. Omit them to keep each comp's work area.

The pattern scan is a diagnostic aid, not a complete output validator. Inspect the expected files, duration and representative frames before you accept the batch. A Slack post failure never masks a render failure here. The notifier returns zero regardless, and the render result (log parse plus exit code) drives the script's exit status.

## How do I run the batch without leaking my Slack webhook?

Store the webhook in a file with restricted permissions, then launch the script detached. Connect over SSH or remote desktop, run `chmod +x aerender-batch.sh` in Terminal, and run the secret-entry block below in Bash (`/bin/bash`), because its `read` options differ from zsh.

Store the Slack webhook URL without putting its value in shell history or displaying it on screen:

```bash
umask 077
IFS= read -rs -p "Slack webhook URL: " WEBHOOK && echo
printf '%s\n' "$WEBHOOK" > "$HOME/.slack_webhook"
unset WEBHOOK
```

`read -rs` reads silently with no echo. `umask 077` restricts a newly created file. Run `chmod 600 "$HOME/.slack_webhook"` as well if the file already existed. The example passes the URL to curl, where it can be visible to a local process inspector during the request, so use this only in your own trusted account on a single-user Mac, and use a secret manager for anything shared. Confirm with `ls -l ~/.slack_webhook` that the mode is `-rw-------`, then move on.

Launch the job and detach it from the terminal:

```bash
export PROJECT_PATH="$HOME/projects/MyMotionProject/MyMotionProject.aep"
# Replace the path and AE_VERSION with the actual installed project and app.
export AE_VERSION="2024"
nohup ./aerender-batch.sh >/dev/null 2>&1 &
disown
echo "PID $!"
```

`nohup` prevents a `SIGHUP` when the controlling terminal closes, which is enough to survive closing your SSH session. It does **not** guarantee the process survives a restart, a macOS user logout or a reboot, because on macOS those end user processes. Keep the macOS user session signed in while the render runs. A per-user LaunchAgent can also end at logout, so do not treat it as a guarantee. `caffeinate` can prevent idle sleep while the user session is active, but it does not disable screen locking or prevent an administrative restart.

Reconnect any time and tail the log:

```bash
tail -f ~/ae-logs/render_*.log
```

## Which Figment Mac plan fits an After Effects batch?

For most batches, start with the [Apple Silicon Mac VM](/mac-hosting#apple-silicon-vm). A daily plan covers 24 hours from the order, which suits an overnight run: one night costs $6. We have not measured GPU, Metal or After Effects render speed on any Figment plan, and GPU behaviour inside a VM is not measured.

| Scenario | Plan | Day | Month | Twelve months |
|---|---|---:|---:|---:|
| CPU-bound text and shape comps, overnight batches | [Apple Silicon Mac VM](/mac-hosting#apple-silicon-vm) (4 shared vCPUs, 4GB RAM, 65GB SSD) | $6 | $39 | $468 (12 x $39) |
| GPU-accelerated effects (Element 3D, Maxon tools, Metal-accelerated AE effects), large comps, or consistent render times | [Dedicated M4 Pro 48 GB](/mac-hosting#dedicated-m4-pro) (whole Mac: M4 Pro, 48GB RAM, 512GB SSD) | Monthly only | $349 | $3,228 paid up front, or $3,588 (12 x $299) | |
| Intel-only plug-ins that Adobe supports on macOS Sequoia | [Intel Mac VM](/mac-hosting#intel-vm) (4 shared vCPUs, 4GB RAM, 80GB SSD) | $2 | $25 | $300 (12 x $25) |

For GPU-heavy or Metal-dependent effects, or plug-ins that need a whole machine, use the Dedicated M4 Pro 48 GB by the month ($349, cancel any time) and render your own project in the first days. VM vCPUs are shared, not reserved cores. Check Adobe's system requirements for your After Effects version against the macOS version shown before purchase. The Intel Mac VM cannot run arm64-only plug-ins.

For a sanity check against a comparable rental, [MacStadium's pricing page](https://www.macstadium.com/pricing) lists the M4.S (M4 10-core, 16 GB RAM, 256 GB SSD) at **$149/month** and the M2.S (M2 8-core, 8 GB RAM, 256 GB SSD) at **$109/month**, with support, bandwidth and a dedicated IP included and a published 99.99% uptime target. Those are whole Macs, so the closest Figment match is the Dedicated M4 Pro 48 GB at $349 (48GB RAM, 512GB SSD), not the shared VM at $39.

A single-user Creative Cloud subscription may be activated on two machines but may not be used on both at the same time. Quit After Effects on your workstation before you launch it on the rental, or add a seat. Plug-in licences are separate, so move or buy them per your vendor's terms. Billing runs from the order until you stop the Mac in Figment, even when it is disconnected or shut down, so copy your outputs off and stop it when the batch is done.

Related reading:
- [Consolidate a Logic Pro Session on a Rented Mac](/blog/mac-logic-pro-session-consolidation)
- [Run an ExifTool IPTC Metadata Batch](/blog/mac-exiftool-iptc-batch-metadata)
- [Set Up a GitHub Actions Self-Hosted Runner](/blog/mac-github-actions-self-hosted-runner)
