2.1.14 The Origin Command Window and Script Window

Application of the Command Window

The Origin Command Window is used to execute LabTalk script, with options to show command history and use auto completion.

It is accessible from Window:Command Window menu item or the Alt + 3 hot key.

You may refer to this tutorial to learn how to use the Command Window to carry out different tasks.

Layout of Command Window

The Command Window consists of two panels:

The Layout of the Command Window.png

The History Panel

This panel maintains a history of all script commands issued by the user. By default, only commands that execute successfully are added to the history (though this behavior can be modified using the Preference short-cut menu command in the Command panel -- see below).

Right-click for shortcut menu options:

Save As LabTalk Script (OGS)

This command is available when a selection has been made from the command history. You can then save selected lines to a script OGS file for future use.


This command allows you to simply highlight a section of the history and immediately execute selected commands.


This command allows you to copy selected commands from history for pasting into the command panel or to another source such as a text or OGS file.


This command can be used to clear the entire panel or selected text only.


This command can be used to print the entire panel or selected text only.


This command can be used to change the relative position of the history panel so that it appears to the left, right, above or below the command panel. Note that the Command Window needs to be closed and re-opened for the change to take effect.

The Command Panel

This panel accepts script command input from the user. This panel is also used to present output from X-Functions, Help content for X-Function commands, and error messages.

Right-click for shortcut menu options:

Save As

This command allows you to save all the text in this panel to a text (.TXT) file on disk.


This command is available when a section of the command line is selected which does not include the prompt.


This command is available when you have selected some Command panel text. This command can be used, for example, to highlight and copy output sent to this panel by an X-function command, so that the output can be copied and pasted into another application.


This command allows pasting text copied from another source -- such as from the history panel, lines of script from a text file, etc.


This command can be used to clear the entire panel or selected text only.


This command can be used to print the entire panel or selected text only.


This command opens a dialog box that provides control for the following:

  • Auto Compete:
This option controls auto completion of X-function commands typed into the command panel. You can set the auto complete to start automatically (default), turn it off, or have it start only when you press the right arrow key.
  • Prompt:
You can select the default prompt of ">>" or you can opt to show the current time or the current working directory.
  • Add to Command History:
This controls whether duplicate and failed commands should be added to command history.

Script Window

The Script Window predates the Command Window and lacks some of its features. However, it remains a useful tool for issuing simple LabTalk commands.

The Script Window was updated for Origin 2023 and now supports Unicode, auto-completion and syntax-coloring; plus font-size control by pressing Ctrl while scrolling with the mouse wheel. If you prefer the old Script Window, you can restore it using LabTalk system variable @NSW=0 (for help with setting the value of a system variable see changing the value of a LabTalk system variable).

Open the Script Window by clicking Window: Script Window or pressing Shift+Alt+3.

Layout of the Script Window

The Script Window consists of a single panel.

OH script window features.png

  • New: Clears the window.
  • Open: Open a LabTalk Script (*.ogs) or other text file.
  • Save: Save changes to current ogs/txt file.
  • Save As: Save content as ogs/txt file.
  • Print: Print window contents.
  • Undo:
  • Redo:
  • Cut:
  • Copy:
  • Paste:
  • Delete: Deletes selected content.
  • Insert newline: Insert line at the cursor (without executing script). Shortcut key: Ctrl + Enter
  • Find:
  • Replace:
  • Enable Auto Complete: Toggle autocomplete function.
  • Enable Syntax Coloring: Toggle syntax-coloring function.
  • Script Execution: Disables execution of script by pressing Enter.

Hide the Script Window without clearing content (differs from the "x" button in the upper-right that will close AND clear content).