Manual contents

Scripting (Expert)

Scripts are Lua 5.5 files in the scripts folder; each appears in Tools > Scripts. startup.lua runs when the first Expert window opens, after the plugins' Lua, and Tools > Scripts > Reload Scripts starts both again. The Lua console (View > Panels > Lua Console) runs statements, and = expression prints a value.

  • editor is the Scintilla API of the current view, with SciTE-compatible names: editor:GotoLine(10), editor:ReplaceSel("x"), editor:AddText("text"), properties such as editor.CurrentPos and editor.LineCount, and indexed properties such as editor.LineEndPosition[line] or editor.StyleBold[style] = true. Helpers: GetText, SetText, GetSelText, GetLine(n), TextRange(a, b).
  • tripad is the application: message(text), alert(text), prompt(title, default), output(...), open(path), new(text), save(), command("Line.SortAsc"), mode(), setMode("expert"), filePath(), fileName(), language(), setLanguage("python"), encoding(), clipboard(), setClipboard(text), documents(), dataDir(), version(), register(name, function) to add a Tools > Scripts entry, and on(event, function) for the "open", "save" and "switch" events.

Command names for tripad.command are listed in the Command Id column of the Keyboard Shortcuts editor (Tools > Keyboard Shortcuts), for example File.Save, Edit.Copy or Compare.Next.