All templates
ScriptingIntermediate
Display JavaScript Output
Robomotion•Updated 9 months ago

Overview
Executes an inline JavaScript snippet and surfaces its return value in a dialog. Demonstrates the JavaScript Run node.
Display JavaScript Output
JavaScript is a web programming language used both on the client-side and server-side. Flows allow users to implement custom web automation behavior and handle web components through JavaScript code.
What Display JavaScript Output can do
- Run Node script (
Core.Process.StartProcess) — runsnodewith-e 'var variableName = "Hello World!"; console.log(variableName);', captures stdout intomsg.javascript_output. - Trim output (
Core.Programming.Function) — strips trailing CR/LF frommsg.javascript_output. - Message Dialog (
Core.Dialog.MessageBox,optType: info) titledOutput from JavaScript:showsmsg.javascript_output, thenCore.Flow.Stop.
Behind the scenes
console.logwrites to the Node.js process stdout, whichCore.Process.StartProcesscaptures intomsg.javascript_output— the dialog shows stdout, not a return value.- The inline snippet intentionally avoids any Node-specific APIs so it runs anywhere a
nodebinary is on PATH.
More scripting templates
See all 7 →- Convert Excel to PDF Using VBScriptRuns an inline VBScript that drives Excel COM to export a workbook as PDF. Shows how to bridge Robomotion with Windows scripting.
- Display PowerShell OutputRuns a PowerShell script and displays the captured standard output in a dialog.
- Display Python OutputRuns an inline Python script and shows its output in a dialog. Demonstrates the Python Run node.
- Display VBScript OutputExecutes a VBScript snippet and displays its output. Useful when integrating with legacy Windows tooling.
- Extract Text from Word DocumentUses a VBScript bridge to pull raw text out of a .docx file for downstream NLP or search indexing.
- Get Login Name Using PythonRetrieves the current Windows login user via an inline Python script. Handy for audit trails or user-scoped paths.