3.7.5.44 Note

LabTalk Object Type:

Utility

The note object has properties to provide access to the active Notes window. The object properties can be accessed using the following syntax:

note.property

To create a Notes window, refer to the window command.

To see details about how to edit HTML in Notes window, refer to Notes window document.

Properties:

Property Access Description
note.active Read only,
numeric

Return the active window type.

  • 0 = Active window is not a Notes window.
  • 1 = Notes window is active.
note.phsheet$ Read/write,
string

Get/set placeholder sheets of the active Note window

note.readonly Read/write,
numeric

Switch between read-only mode and editable mode. Only work if note.view = 0.

  • 0 = Editable mode (default)
  • 1 = Read-Only mode.
note.spacing Read/write,
numeric

Get/set line spacing. 0 means using global.

Note.Spacing=80
note.syntax Read/write,
numeric

Switch to colored HTML syntax.

  • 0 = plain text (default),
  • 1 = colored HTML syntax
  • 2 = Markdown syntax
note.text$ Read/write,
string

Get/set the text of the active Notes window.

note.view Read/write,
numeric

Switch between Text Mode and Render Mode.

  • 0 = text editor (default),
  • 1 = render with HTML browser.
note.width Read/write,
numeric

Notes window page width (units = in/cm/etc.). Default = 0, which corresponds to an uncontrolled width.

For most purposes, the default will suffice when printing to PDF or paper. If you do specify note.width, do not exceed Paper SizeMargins or your text may be cut off (see File: Page Setup).

Methods:

Method Description
note.Close() Close the active Notes window.
note.Duplicate() Duplicate the active Notes window.
note.ExportHTML() Export the active Notes window to an HTML page.
note.Load() Load the specified HTML file to the active Notes window.

Examples:

window -n n Sample;    //Create a Notes window named "Sample"
note.text$=
<html>
<body>
	<h1>Hello World</h1>
	<p>This is a very basic example of inserting two Link Field Codes into an HTML page.<p>
	<p><em>Note: If you modify the graph or save the project and are in HTML view mode, hit <strong>F5</strong> 
               to refresh the HTML page.</em></p>
	<!-- Observe that only width is specified. Browser will set the height automatically-->
	<img alt="{{graph://Graph1}}" width="500">
</body>
</html>;
//Set text content 

note.view = 1;   //Render with HTML browser

note.ExportHTML(D:\Sample.html);// export the Note window to the html file.
window -n n NewNote //Create a Notes window named "NewNote"
string htmlfile$=system.path.program$+"\Samples\HTML\Hello World.html";
note.Load(htmlfile$) // load a html file in the active note window.