Type

Outputs a string to the specified device.

Contents

Syntax

type  option  string

Notes on Use

Escape Sequence Description
\n

New line

\r

Return

\d

Delete

\t

Tab

\u

Convert number to Unicode Char

\xhh

ASCII character; hh are hex digits


For example:

// Note: ASCII character 61 (hexadecimal 3D) is the equal sign.
// Output to a pop-up attention window the text "Test A"
// then on a new line type "Test B = Test C":
 
type -b "Test A \n Test B \x3d Test C";
type "\u2554====\u2557";//╔======╗

// Output to a pop-up attention window the text in ''BadCalculation'',
// in the '''General''' section of the ORIGIN.OMG file.

Type -b $General.BadCalculation;
Notes:

Options

no option; Print string to the Script window

Syntax: type string

Print string to the Script window.

no option; string = ogsFileName; Print out the contents of the specified script file

Syntax: type ogsFileName

Running and Debugging LabTalk Scripts: Debugging Tools.

-a; Open the Script Window and print string

Syntax: type -a string

Open the Script Window (if it is hidden or closed) and print string.

-b; Display string in a dialog box with an OK button

Syntax: type -b string

If the string is omitted, this command produces a beep.

-c; Display string in a dialog box with OK and Cancel buttons

Syntax: type -c string

-gb; Type text to a file

Syntax: type -gb[e][f][n|r] filename

Send all subsequent type command strings to a file. End writing to file with type -ge.

If neither n nor r is specified then output CRLF for end-of-line. Use type -l <text> to output with no end-of-line.

type -gb %Yjunk.txt;
type "some thing1";
type "some thing2";
type "some thing3";
type -ge;

-ge; End typing text to file

Syntax: type -ge

End writing to a text file. Used after type -gb.

//store some information to the active page storage area and type the tree to a file
page.tree.experiment.sample.RunNumber = 45;
page.tree.experiment.sample.Temperature = 273.8; 
type -gbef %Yjunk3.txt;
        page.tree.=;
type -ge;

-h; Hide the Script Window

Syntax: type -h

Hide the Script Window

-html; Create a dialog based on html code

Syntax: type -html "html str"

Create a dialog based on the html code.

type -html "file://Table.html";   // Execute the Table.html file, which is located in the User Files Folder
type -html "http://www.originlab.com";    // Open the website in a dialog
type -html "<button>Click</button>";  // Execute html command line to create an HTML button

-l; Print to the Script Window

Syntax: type -l string

Print to the Script Window, but disable the carriage return and linefeed for this text

-latex; create LaTeX object

Syntax: type -latex string

create LaTeX object

type -latex "y=3+\frac{2}{0.2\sqrt{\pi/2}}e^{-2\frac{(x-1)^2}{0.2^2}}"

-mb; Enable the use of attention messages

Syntax: type -mb n

-me; Disable the use of attention messages

Syntax: type -me

-mg; Get the current value of an entry in the [ReminderMessages] section of origin.INI and assign it to a LabTalk variable

Syntax: type -mg stringoridofentry VarName

-ms; Set the value of an entry in the [ReminderMessages] section of origin.INI

Syntax: type -ms stringoridofentry Value

-n; Display string in a dialog box with Yes and No buttons

Syntax: type -n string

-o; Perform argument operation on the Script window

Syntax: type -o argument

Argument can be one of the following (you need only supply the first letter):

execute Turn Script Execution off. There is no script command to restore execution. User must select Edit : Script Execution in the Script window menu.
new Clears the contents of the Script window.
open [filename] Print the filename contents to the Script window. If filename is not specified, open the Open dialog box. Subsequent use of the File : Save menu option of the Script window or type -o save will write to this file until File : New is selected or type -o new is executed.
print Print the contents of the Script window to the current Windows default printer.
save [filename] Save the current Script window contents. If the open option was previously used and no filename is specified, then that file will be overwritten.
tab pixels Set the tab spacing to pixels pixels. The default value is 45 pixels. All tabs in the Script window will update immediately.
window title Change the title of the Script window to title. The change persists even if the Script window is hidden. Closing the Script window clears the change.

-q; Display string in the status bar

Syntax:type -q string

-qp n Enable or disable the arithmetic status messages that show the progress of calculations. n = 1 (enable) or (disable) n = 0.
-qs n Enable or disable the status bar. Enable (n = 1) or disable (n = 0) the status bar. When the status bar is disabled, the last message displays until the status bar is enabled again.

-s; Types string to a previously open Script window even if it has been hidden

Syntax:type -s string

Unlike the -a option, this command will not open a hidden Script window and it will do nothing if the Script window is closed.

-tb; Type a property of an object to an attention box

Syntax: type -tb object.property

-tn; Type a property of an object to a Yes/No dialog box

Syntax: type -tn object.property

-tq; Type a property of an object to the status bar

Syntax: type -tq object.property

-ty; Type a property of an object to a Yes/No/Cancel dialog box

Syntax: type -ty object.property

-v; Override escape sequence substitution

Syntax: type -v -option message

-y; Display string in a dialog box with Yes, No and Cancel buttons

Syntax: type -y string

Examples

Example #1: Simple text display

The following script displays the message "I'm busy right now" in the status bar.

type -q "I'm busy right now";

The next script displays the message "Here is some text, and here is some more" on one line in the Script window.

type -l "Here is some text";
// other code 
type ", and here is some more";

Example #2: Toggle the display of pop-up attention messages

The next two scripts illustrate use of the type -mb and type -me commands. In this example, you Append a project. Normally, a dialog opens that asks whether to Append to the current folder or to create a new folder. Such messages would normally stop a script until you responded to the message. With the type -mb command, you can override the dialog box.

// Begin override of messages, using a response of No/Cancel 
//- Do not create a folder
type -mb 0;
doc -a D:\SAMPLE.OPJ; // Append an OPJ
// End override of messages
type -me;
// Begin override of messages, using a response of Yes - Create a new folder
type -mb 1;
doc -a D:\SAMPLE.OPJ; // Append an OPJ
// End override of messages
type -me;

Example #3: Over-riding escape sequences

The next script prints "My file is stored in c:\temp\file1.opj." to the Script window.

Note: \t is not interpreted as a tab due to the use of the -v option. Remove the -v and try again to see the effect.

type -v "My file is stored in C:\temp\file1.opj.";

Example #4: Display text contained in a graph object

The last script displays the Bottom X Axis Title text from the active graph window in a dialog box with an OK button.

type -tb "XB.text";

See Also

Type, $() Substitution and its C formatting


Note: You can use Print (command) to print the output text in the Notes window.