-
Notifications
You must be signed in to change notification settings - Fork 5
Scripting Playground
9vult edited this page Aug 19, 2026
·
2 revisions
The Scripting Playground lets you write quick-and-dirty scripts for one-off automations, testing, and more. Playground scripts are written in JavaScript, and function similarly to Scriptlets without the boilerplate.
The following methods and fields are available for you to use:
-
log(message): Log an Info message -
err(message)Log an Error message -
commitOne(event, ChangeType): Commit changes to a single event to history -
commitMany(event[], ChangeType): Commit changes to multiple events to history -
selectOne(event): Select an event -
selectMany(event, event[]): Select multiple events - The
ChangeTypeenum
-
project: The currently-open Project -
workspace: The currently-selected Workspace, may be null -
events: All events in the current Document -
activeEvent: The currently-active Event -
selectedEvents: All currently-selected events -
eventManager: The current Document's EventManager
- Lists are JavaScript arrays, meaning you use
.filter()and.forEach(), not LINQ methods like.Where() - Primitives are JavaScript primitives, meaning it's
activeEvent.Text.toUpperCase(), notactiveEvent.Text.ToUpperCase()
// Workspace may be null (if no workspace is open)
if (!workspace || events.length == 0)
return;
var oddEvents = events.filter(e => e.Index % 2 !== 0);
oddEvents.forEach(e => e.Text = `Event #${e.Index}`);
log(`Modified ${oddEvents.length} events!`);
commitMany(oddEvents, ChangeType.ModifyEventText);
selectMany(oddEvents[0], oddEvents); // Select all modified events & focus the first one