Skip to main content
By default, Nexrender Cloud runs every script in a sandbox. Inside it, a script works with two things: the job’s After Effects project and the job’s folder. It can’t reach the rest of the render node.

What scripts can do

  • Use the After Effects scripting API on the job’s project. Compositions, layers, properties, expressions, footage, and the render queue all work as they do in After Effects.
  • Read and write files in the job’s folder. Build paths from NX.get("nxWorkpath"). Relative paths, and paths that start with ~/, also resolve to the job’s folder. Folder.temp, Folder.desktop, Folder.myDocuments, Folder.userData, and Folder.appData point to folders inside it.
  • Load other script files from the job’s folder with $.evalFile, for example a library you download with a static asset.
  • Use data from outside the job by downloading it with a static asset. Nexrender downloads it into the job’s folder before your script runs, so your script reads it like any other file.
Pass everything else a script needs, such as text, settings, and paths, as parameters. If your workflow needs something the sandbox doesn’t allow, contact [email protected].
Render nodes run Windows or macOS. Build paths with forward slashes, such as NX.get("nxWorkpath") + "/report.txt". After Effects accepts them on both.

Limits

A script can write up to 500 MB to files. Writing more stops the job with a file_write_limit error.

Rules for every script

  • No preprocessor directives. The API accepts the job, but the job fails before rendering if a script uses #include, #includepath, or #targetengine. To share code between scripts, download it with a static asset and load it with $.evalFile. See Load shared code.
  • Dialogs don’t stop the render. alert, confirm, and prompt write their message to the render log instead of opening a dialog. confirm returns false and prompt returns null.
  • Leave render output paths as they are. Nexrender sets the job’s output itself.

Sandbox errors

When a script does something the sandbox doesn’t allow, the job fails before rendering. Its error starts with nexrender: sandbox violation and a code:
Job error
The check happens as soon as the script creates the File or Folder object, before anything is read or written.