Guides / Using Lumit / The application
Updated
Scripts
A script is a JavaScript file that edits the open project. After Effects scripts
(.jsx) run as they are. A script also runs Lumit’s own commands, listed in the
Scripting reference.
Run one
Section titled “Run one”- Choose File ▸ Scripts ▸ Run script….
- Pick the
.jsor.jsxfile.
A script dropped on the window runs after one question.
While it runs, a card covers the window with the script’s name and Stop. A file the script asks for opens the system file dialogue, and a message it shows appears in the status line.
The whole run is one undo step, named after the first name the script gives
app.beginUndoGroup(), or after the file. A script that fails or is stopped leaves the
project as it was.
When a script fails, the status line gives the reason and the line it failed on.
When a script prints with $.writeln() or shows an alert(), Show log on the status
line lists the lines, with Copy. Alerts come after the printed lines.
The Scripts folder
Section titled “The Scripts folder”File ▸ Scripts lists the .js and .jsx files in the Scripts folder, with a submenu
for each folder inside it. Open scripts folder shows it in the file manager.
| Windows | %LOCALAPPDATA%\Lumit\Lumit\data\scripts\ |
| macOS | ~/Library/Application Support/dev.Lumit.Lumit/scripts/ |
| Linux | ~/.local/share/lumit/scripts/ |
Settings ▸ General ▸ Scripts folder lists another folder instead. Clear goes back.
Event scripts
Section titled “Event scripts”The Scripts rows in Settings ▸ General run a script from the Scripts folder after an event. Each is None until set.
| Row | Runs after |
|---|---|
| Export finished | each export from the export queue |
| Project opened | a project opens |
| Project saved | the project is saved |
It runs as from the menu, and the status line names it after.
lumit.args.event | "export", "open" or "save" |
lumit.args.file | the exported file’s or the project’s file name, without its folder |
An event script is skipped while another script runs. A script’s own saves and exports, and the save made before a project closes, run none.
After Effects scripts
Section titled “After Effects scripts”| Object | What works |
|---|---|
app | project, newProject(), beginUndoGroup(), endUndoGroup() |
app.project | items, numItems, item(), rootFolder, activeItem, file, importFile(), save() |
items | addFolder(), addComp(), length, [n] |
| Any item | name, parentFolder, comment |
CompItem | width, height, duration, frameRate, frameDuration, pixelAspect, numLayers, layer(), layers, markerProperty, openInViewer(), saveFrameToPng() |
layers | addCamera(), addNull(), addSolid(), add() of footage or a comp, precompose(), byName(), length, [n] |
| Any layer | name, index, enabled, guideLayer, threeDLayer, shy, solo, locked, motionBlur, startTime, inPoint, outPoint, parent, setParentWithJump(), autoOrient, moveToBeginning(), moveToEnd(), moveBefore(), moveAfter(), remove(), property(), transform, Effects, marker |
| Properties | Anchor Point, Position, Scale, Orientation, X, Y and Z Rotation, Opacity, and a camera’s Point of Interest, Zoom, Focus Distance and Aperture, by match name or by name |
| Keys | value, valueAtTime(), setValue(), setValueAtTime(), setValuesAtTimes(), addKey(), removeKey(), numKeys, keyTime(), keyValue(), setInterpolationTypeAtKey(), setTemporalEaseAtKey(), keyInTemporalEase(), keyOutTemporalEase(), setTemporalAutoBezierAtKey(), setTemporalContinuousAtKey(), setSpatialTangentsAtKey() |
| Expressions | expression, expressionEnabled |
| Effects | addProperty() by match name or name, property() by number, match name or Lumit’s name, numProperties, name, enabled |
| Markers | setValueAtTime() with a MarkerValue, setValuesAtTimes(), numKeys, keyTime(), keyValue(), removeKey() |
FootageItem | mainSource.conformFrameRate, file, duration, width, height, frameRate, frameDuration |
ImportOptions | file, sequence, footage as importAs |
File, Folder | $.fileName, name, fsName, parent, exists, getFiles(), open(), read(), readln(), write(), writeln(), close(), encoding, lineFeed, remove(), Folder.create(), File.openDialog() |
Window | "dialog" and "palette", add() of group, panel, statictext, edittext, checkbox, radiobutton, dropdownlist, slider and button, text, value, selection, items, enabled, onClick, onChange, orientation, alignChildren, alignment, margins, spacing, show(), close() |
| Globals | alert(), $.writeln(), writeLn(), AutoOrientType, KeyframeInterpolationType, KeyframeEase, MarkerValue, ImportAsType |
Anything else stops the script with a message naming it.
Where Lumit differs
Section titled “Where Lumit differs”- A Bezier key with no ease of its own is automatic. Spatial tangents are not carried, so a point moves between keys in a straight line.
valueAtTime()reads between eased keys in a straight line.- Roving keys stay at their times.
- Key times land on the nearest frame of the comp.
- A camera a script adds, and a layer it makes 3D, turn in After Effects’ rotation order and keep their X, Y and Z Rotation as they are. On a 3D layer in Lumit’s order they are turned into that order, which matches After Effects on every key.
- A layer given a
parentstays where it is at the comp’s start. app.newProject()answers the open project.activeItemis the comp open in the Viewer. On the command line it is the project’s only comp, or null when there are more.- An expression is JavaScript. While it is on, the keys under it are not kept.
- An effect Lumit does not have stops the script. Controls named by number or match name take After Effects’ values and convert them as importing does. By name, they take Lumit’s own.
- A marker keeps its comment, duration, label colour and whether it is a chapter. Chapter text, URLs and cue points are not kept.
- A numbered still always imports as the whole sequence.
- A comp’s or solid’s pixel aspect is not kept.
#targetlines are skipped.#include,//@includeand#includepathread in files from the script’s own folder and the folders inside it, each once.- A script’s window is drawn with Lumit’s own controls. Fonts, colours and places are not
kept, and sizes,
marginsandspacingare taken roughly. A palette waits as a dialog does. - Escape or the close mark presses a window’s Cancel button, or makes
show()answer 2. - On the command line and over MCP,
show()answers 2 at once. - A script reads and lists files in its own folder and the folders inside it, and files you
chose or passed to it. A script at the top of a drive or in the home folder itself has no
folder of its own. Anywhere else
existsis false. - A script writes text files, as UTF-8, only in its own folder and the folders inside it, and never over the project. A run writes at most 64 MB. A script with no folder of its own, as over MCP, writes nothing.
- A script imports footage only from the files it can read. It saves the project over its own
file or as a new
.lumfile, and exports and saves frames, only into the project’s folder or its own, never over a file. - A network path or a device is refused.