Skip to main content
Simular Pro gives you the highest level of flexibility and precise control over the full desktop via Simulang, a specialized set of intuitive and easy-to-use action building blocks defined on top of Javascript. While basic prompting of Simular using the chat mode may produce a good initial plan (in Simulang), full success for complex workflows may require edits to some steps in the plan. The best way to learn Simulang is by examples. Find out how to:

General

Act

Completes a task specified in natural language, up to a maximum number of steps. Returns: None
function Act({
    task: String = "",
    maxSteps: Int = 100
})

Application

Open

Open or switch to an application. Returns: None
function Open({
    app: String = null,
    url: String = null,
    waitForLoadComplete: Bool = true,
    waitTime: Int = 0
})

Keyboard control

Type

Type using the keyboard. Returns: None
function Type({
    text: String,
    withReturn: Bool = false,
    waitTime: Int = 0,
    waitForLoadComplete: Bool = false
})

Shortcut

Perform keyboard shortcut in the current application. Returns: None
function Shortcut({
    key: String,
    cmd: Bool = false,
    ctrl: Bool = false,
    option: Bool = false,
    shift: Bool = false,
    waitTime: Int = 0
})

Mouse Control

Click

Click on something, either specified by the at argument or the element argument. Disambiguate by specifing the spatial relation between the target element and an anchor concept. Available modes:
  1. default is text-based grounding.
  2. “textAndScreenshot”: grounding using both text and vision.
  3. “vision”: vision-only grounding. When using modes with vision, all other arguments are ignored except withCommand, clickType and waits.
Returns: None
function Click({
    at: String = "",
    mode: String = "",
    clickType: String = "left",
    withCommand: Bool = false,
    element: UIElement = null,
    spatialRelation: String = "",
    anchorConcept: String = "",
    prior: String = "none",
    position: String = "center",
    includeInvisible: Bool = false,
    waitForLoadComplete: Bool = false,
    waitTime: Int = 0
})

Move

Moves the cursor to an object. Disambiguate by specifing the spatial relation between the target element and an anchor concept. All parameters besides to have the same definition as those in the Click action. Returns: None
function Move({
    to: String = "",
    element: UIElement = null,
    spatialRelation: String = "",
    anchorConcept: String = "",
    prior: String = "none",
    includeInvisible: Bool = false,
    waitForLoadComplete: Bool = false,
    waitTime: Int = 0
})

Drag

Drag on the screen, starting from where the mouse is located Returns:
function Drag({
    to: String = "",
    element: UIElement = null,
    destinationApp: String = null
})

Scroll

Scroll on the screen in a specified direction. Returns: None
function Scroll({
    direction: String = "down",
    distance: Int = 200
})

Perception

ConceptsExist

Checks if all the concepts can be found on the current visible screen. Returns: If all concepts can be found, returns true, otherwise false.
function ConceptsExist({
    concepts: [String]
})

pageContent

Gets a JSON object containing the structural text content and base64 encoded image of the current screen. This object can be sent to a vision-language model for answering questions about the current screen. Returns: A JSON dictionary with the following fields:
  • text: A text description of the current web page;
  • imageFilePath: temporary location in memory of the screenshot (accessible by ask).
function pageContent({
})

Text Generation

ask

Runs a large vision-language model on the given input prompt string and a JSON dictionary context. Often used after pageContent(). Returns: String response from a large vision language model.
function ask({
    prompt: String, context: [[String: String]]
})

Wait

Wait

Put Agent into sleep state for a certain amount of time. Returns: None
function Wait({
    waitTime: Int, unit: String = "s"
})

WaitForConcepts

Waits until all concepts can be found in the current frontmost window. If not all concepts can be found within 10 seconds, action returns failure Returns: None
function WaitForConcepts({
    concepts: [String]
})

User interaction

Respond

Respond to the user with a message and optionally ask for user confirmation to proceed. Returns: None
function Respond({
    message: String, requireConfirm: Bool = false
})

System IO

CopyToClipboard

Copies a String to clipboard. Returns: None
function CopyToClipboard({
    text: String
})

GetFromClipboard

Get the content of the current clipboard. Returns: Content of the currrent clipboard
function GetFromClipboard({
})

SaveScreenshot

Takes a screenshot of an element on the screen or the whole screen, and saves the screenshot as a PNG to a file. Returns: None
function SaveScreenshot({
    element: UIElement = null,
    fileName: String = null,
    directory: String = null
})

ScreenshotToClipboard

Take a screenshot of an element or the current page and save it to the system clipboard Returns: None
function ScreenshotToClipboard({
    element: UIElement = null
})

ReadFile

Read the contents of a file whose location is specified by path. Returns: Contents of the file as a String
function ReadFile({
    path: String
})

WriteToFile

Writes the given text to a file. If the file already exists, then appends text to it, with an option to overwrite the existing content. Unless specified path, writes to /Library/Caches/com.simular.Simular-Pro/SimularActionResult/ Will throw an error if there is an existing non-folder file named SimularActionResult Returns: None
function WriteToFile({
    text: String,
    path: String? = "SimularActionResult.txt",
    overwrite: Bool = false
})

Google Sheet control

GetGoogleSheetCellValue

Gets the value of a cell in a Google Sheet. Returns: Value of the cell
function GetGoogleSheetCellValue({
    cell: String
})

SetGoogleSheetCellValue

Sets the value of a Google Sheet cell. Returns: None
function SetGoogleSheetCellValue({
    cell: String, value: String
})

GetGoogleSheetColumns

Gets the column ids of each header in a given array of column headers in a Google Sheet. For example, if the sheet has column headers “website”, “description”, “date” in cells A1, B1, C1, respectively, then GetGoogleSheetColumns(headers: ["website", "description", "date"]) returns [“A”, “B”, “C”] Note: This function currently assumes that the table headers are on row 1. Returns: Array of column id, each is a capital letter from A to Z
function GetGoogleSheetColumns({
    headers: [String]
})

Advanced GUI functions

GetElements

Get elements that satisfy some conditions inside the current frontmost application or inside a root element (if given). For disambiguation, one can constrain the search to elements that satisfy certain spatial relations to anchor elements. This function supports multiple return types according to returnType. Returns: Depending on returnType: [UIElement], String, [String], [String: UIElement]
function GetElements({
    elementRoles: [String] = [],
    elementOverallDescription: String = "",
    threshold: Double = 0.75,
    root: UIElement = null,
    spatialRelation: String = "",
    anchorRole: String = "",
    anchorOverallDescription: String = "",
    anchorElements: [UIElement] = [],
    horizontalRank: Int = null,
    verticalRank: Int = null,
    sortBy: String = "",
    useNeighborForMissingDescription: Bool = false,
    returnType: String = "elementArray"
})

GetAttributeOfElement

Searches for an element that matches the input criteria and gets the element’s value for a specified attribute. Returns: String value of an attribute of an element
function GetAttributeOfElement({
    elementRole: String = "",
    elementOverallDescription: String = "",
    attribute: String = "",
    threshold: Double = 0.75,
    root: UIElement = null,
    spatialRelation: String = "",
    anchorRole: String = "",
    anchorOverallDescription: String = "",
    anchorElements: [UIElement] = [],
    horizontalRank: Int = null,
    verticalRank: Int = null
})

GetContent

Get text content from the current frontmost window or a region corresponding to the provided concept or element. Returns: If inElement argument is given or the frontmost window was used (because neither inConcept nor inElement was given), then returns a single String. Otherwise, returns a [String] array with one String per root element.
function GetContent({
    inConcept: String = "",
    inElement: UIElement = null,
    format: String = "flat"
})

GetCells

Get all cells from a row or column element. Either row or column must be given. Returns: An array of cell elements contained in the given row or column. If input is a row, the output array is sorted by increasing x-coordinate (left to right). If input is a column, the output array is sorted by increasing y-coordinate (top to bottom).
function GetCells({
    row: UIElement = null, column: UIElement = null
})

GetCellValue

Get the value of a given cell element. Returns: Value contained in the cell.
function GetCellValue({
    cell: UIElement
})

GetCellLabel

Get the label of the given cell element in Excel. Returns: cell’s label String. Example: “A1”
function GetCellLabel({
    cell: UIElement
})

GetCellIndices

Given an array of table cell values, return a corresponding array of cell indices. For example, suppose the table has value1 in cell A10, then GetCellIndices(cellValues: ["value1"]) returns [“A10”] Returns: [String] array of cell indices
function GetCellIndices({
    cellValues: [String]
})

GetTableColumn

Given a header or a index String, return the column under it as [index: Element] dictionary If the table has a column with header “Website” in cell A1, and elements elem1 and elem2 under it, then this function returns [“A2”: elem1, “A3”: elem2]. Returns: Dictionary of [String: UIElement] pair for all information in the column under header
function GetTableColumn({
    header: String = null, index: String = null
})

GetStructuredDescription

Gets XML-formatted description of the contents in each element. Returns: An array of String [s_1, ..., s_n], where each s_i is an XML-formatted description of the contents rooted at u_i.
function GetStructuredDescription({
    fromElements: [UIElement]
})