Tutorial

Getting Started with Macros

Macro Editor

User Interface

Menus and Toolbar

Editing Macros

Macro Debugging

How To

Using variables

Finding and modifying objects

Creating new page content

Copying and moving objects

Asking for user input

Storing persistent data

Using binary data

Sorting objects

Macro menus

Bulleted and numbered lists

Accessing the file system

Accessing the clipboard

Sample Macros

Concepts

Code Structure

Expressions

Objects

Properties

Variables

Data Types

Arrays

Functions

Literals

Operators

Comments

Last updated on: May 01, 2026
Also available as a single HTML file

Onetastic Macro Documentation > Concepts > Data Types

Data Types

Following is the list of data types in macros. Properties can be of one of these data types and variables can be of one of the base types.

Base Types

NamePossible Values
Booltrue, false
StringAny text
NumericAny positive or negative integral or floating point value or zero (0)
Date/TimeType of date/time related properties (e.g. createdTime, lastModifiedTime) in several objects. If converted to a string or used in a string context (as a parameter to String functions) it has the following format: YYYY-MM-DDTHH:MM:SS.000Z as specified here. Date/Time functions can be used to easily retrieve parts of this and convert them to user readable strings.
TimeSpanRepresents a span of time. TimeSpan values can be created by TimeSpan function and can be used to add or subtract from Date/Time values using DateTime_Add and DateTime_Subtract functions.
ColorType of the color properties (e.g. fontColor, highlightColor) in several objects. Colors are stored in the canonical #rrggbb format or as automatic if no color was set (e.g. no highlightColor or the default fontColor). Color names like: black, blue, red, yellow etc. or the value automatic can be used to set or compare variables or properties of type Color. The function Color can be used to create variables of type Color. See also the possible values for color names at Color
BinaryBinary data for an Image or an EmbeddedFile. Binary data can be obtained from binary store to create Image or EmbeddedFile objects. See Using binary data for more information.
ArrayA set of values of any base type. See Arrays.
ObjectA OneNote object or a dialog box.

Restricted Types

Restricted types are String types that can only have one of a set of possible values.

Selection

Description

Type of the selection property in several objects. For objects that aren't selected, it will have a value of "none", while for selected objects it will have a value of "all" or "partial" depending on how much of it is selected. For instance a partially selected paragraph will have a value of "partial".

Possible Values

"none", "partial", "all"

SuperSub

Description

Type of the supersub property in Text and Paragraph objects. If the text is formatted as a superscript or subscript, then it will have a value of "super" or "sub" value, otherwise it will have a value of "none".

Possible Values

"none", "super", "sub"

ContentType

Description: Type of the contentType property in Paragraph objects.

Possible Values: "image", "table", "text", "ink drawing", "ink writing", "embedded file", "embedded media", "unknown"

ImageFormat

Description

Type of the format property in Image objects.

Possible Values

"png", "jpg", "emf"

Alignment

Description

Type of the alignment property in Paragraph objects.

Possible Values

"left", "center", "right"

Orientation

Description

Type of the orientation property in Page objects.

Possible Values

"portrait", "landscape"

ObjectType

Description

Type of a OneNote object.

Possible Values

"NotebookRoot", "Notebook", "SectionGroup", "Section", "Page", "Title", "Outline", "Table", "Column", "Row", "Cell", "Paragraph", "Text", "Image", "EmbeddedFile"

ParagraphStyle

Description

Type of the style property in Paragraph objects.

Possible Values

"p", "h1", "h2", "h3", "h4", "h5", "h6", "PageTitle", "cite", "blockquote", "code"

DateTimePickerType

Description

Type of a Date/Time picker control in a DialogBox.

Possible Values

"date", "time", "datetime"

Reference

Statements

Hierarchy Objects

Page Objects

Other Objects

Functions

Array Functions

Clipboard Functions

Data Store Functions

Data Type Specific Functions

Date/Time Functions

Dialog Box Functions

File System Functions

Macro Execution Functions

Macro Menu Functions

Object Functions

Special Functions

String Functions

Window Functions