Skip to content
NeoScript overview
NeoScript

NeoScript

Write, record and run JavaScript scripts that control NeoMath, with a macro recorder, quick button, shortcuts and per-folder permissions.

On this page

NeoScript lets you write, record, store and run JavaScript scripts that control NeoMath: build equations, export to SVG, PNG or EPS, convert whole folders, recognize equations from images, open and save files, switch tabs, change preferences and trigger interface actions. All through a ready global object, neo.

What it is for#

  • Repeat tasks: export dozens of equations, convert a folder, standardize colors and styles.
  • Generate equations from data: a table of formulas, the terms of a series, a list of exercises.
  • Record what you do in the editor and turn it into code (macros).
  • Let an AI write and run scripts through the MCP server.

Golden rules#

  1. All neo functions are synchronous: the script waits for each one to finish.
  2. Errors become ordinary JavaScript exceptions; try/catch works.
  3. No disk and no network by default. The script only touches the folders you allow.
  4. A script never runs by itself: only when you tell it to (button, shortcut or command line).
  5. The Stop button interrupts the script immediately, even in an infinite loop.

First script#

  1. Open Menu › NeoScript. The screen fills the window; Esc goes back to the editor.
  2. Click New blank script (or New from a template…).
  3. Write the code below and click Run (F5 or Ctrl+Enter).
JavaScript
neo.equacao.limpar();
neo.inserir("\\frac{a}{b}");
neo.digitar("+1");
console.log(neo.equacao.latex());

The equation appears in the editor and \frac{a}{b}+1 appears in the Output tab.

The NeoScript screen#

  • Left: the script list. The dot marks the active script (the one the quick button runs). Above: new, duplicate, move and delete.
  • Right, top: the code editor with colors, line numbers, name, shortcut, Save, Format, Record macro and Run (becomes Stop).
  • Right, bottom: Output (what the script writes, warnings and errors with the line) and Permissions (allowed folders).
  • Documentation (F1): opens the handbook in the browser, as PDF or copies everything for an AI.
Editor shortcut What it does
Ctrl+S saves
F5 or Ctrl+Enter runs
Ctrl+Shift+F formats the code
Tab two spaces
F1 documentation

Format is conservative: it indents with two spaces and organizes spaces and braces, but never changes quotes, never reorders and touches nothing if there are mismatched parentheses or braces.

Where scripts live#

System Folder
Windows %APPDATA%\NeoMath\scripts
Linux ~/.config/NeoMath/scripts
macOS ~/Library/Application Support/NeoMath/scripts

Each script is a Name.neoscript.js file. The order, shortcuts, active script and allowed folders are in indice.json. You can version or edit the files outside the app.

Macro recorder#

  1. Click Record macro (on the NeoScript screen or in the quick button list). The Recording macro · N steps bar appears at the bottom of the window.
  2. Work normally: type, insert fractions and roots, change style and color, insert matrices, use undo and the menu.
  3. Tap Stop and edit. NeoMath creates the Recorded macro script with the equivalent code.
JavaScript
neo.digitar("x+1");
neo.inserir("m:fracao");
neo.digitar("a");
neo.tecla("direita");
neo.digitar("b");

Mouse clicks on the equation and what happens inside system dialogs are not recorded.

Quick button and shortcuts#

Next to the OCR button is the NeoScript button: a click runs the active script (and becomes Stop while it runs); the arrow opens the script list, Record macro and Manage scripts….

Each script can have a shortcut: F6 to F12 or Ctrl+Shift with one of the letters J K L M Q R T U. A script never fires on a shortcut that NeoMath’s profile already uses.

Security and permissions#

The script runs isolated, with no require, import, fetch, process or direct disk access.

  • In the Permissions tab, allow one folder at a time, read-only or read and write.
  • .., relative paths and symbolic links do not get around the barrier: the path is resolved to its real destination before each access.
  • neo.acao does not trigger sair, dialogs or NeoScript’s own actions.
Where Time Memory
App 300 s 256 MB
Command line 60 s 256 MB
MCP 30 s (up to 300) 128 MB (up to 1024)

Exceeding the time limit ends the script and cannot be worked around with try/catch. Output is limited to 1 MB per run.

Next steps#