Skip to content

Env

The env module provides some contextual information for flows.

Username

Get the username for the current user.

Example

javascript
var u = Env.userName;

Name of machine

Get the name of the machine.

Example

javascript
var m = Env.machineName;

Domain

Get the domain for the current user.

Example

javascript
var u = Env.userDomain;

Groups

Get the AD groups for the current user. Includes user name and machine name.

Example

javascript
var groups = Env.userGroups;

groups will now be an array of strings.

Primary screen

Get information about the primary screen of the local machine.

Example

javascript
var s = Env.primaryScreen;

s will now be an object like so:

javascript
// s
{
  width: 1024,
  height: 768,
  primary: true
}

Screens

Get information about all the screens attached to the local machine.

Example

javascript
var screens = Env.screens;

screens will now be an array of screen objects, like so:

javascript
// screens
[
  {
    width: 1024,
    height: 768,
    primary: true
  },{
    width: 1280,
    height: 1024,
    primary: false
  }
]

Version

Get the Manatee version.

javascript
var v = Env.version;

Branch

Get the branch of Manatee - can indicate whether its a production or testing version for example.

javascript
var branch = Env.branch;

Session type

Get the current type of windows user session. This allows a flow to know the type of user session it is running under.

Returns one of the following values

  • remotedesktop: The flow is running on a manatee operated through remote desktop client
  • citrix: The flow is running on a manatee operated through a citrix client
  • normal: The flow is running on a manatee that is operated via a normal local login
javascript
if (Env.sessionType !== 'normal') throw Error('Remote automation not supported by this flow!');

Connected

Returns which services Manatee is connected to.

js
var c = Env.connected;
// c is e.g. { kwanza: true } if connected to kwanza

Kwanza

This method returns Kwanza’s about information.

js
Env.kwanza();

will give you e.g.:

json
{
  "Name": "f5d4e5973c5c-c38suabhjrp000cgmri0",
  "Version": "v3.0.3-3-g222c7f9",
  "Color": "orange",
  "Features": [
    "user-management"
  ],
  "Env": {
    "name": "",
    "icon": "",
    "color": ""
  }
}

Webview runtime info

This property provides information about available WebView2 runtime installations, which are used for embedded Edge browser components such as certain sticky components, input dialogs and the built-in Cuesta window.

js
var webviewInfo = Env.webviewInfo;

will give you e.g.:

json
[
  {
    "path": "C:\\USERS\\LOS\\APPDATA\\ROAMING\\SIRENIA\\MANATEE\\PLUGINS\\KANTPLUGIN\\1.0.0\\Kant\\WebView2",
    "version": "103.0.1264.37"
  },
  {
    "path": "system",
    "version": "103.0.1264.44"
  }
]

Depending on its configuration, Manatee may provide its own webview installation or a plugin might provide it. The entry in the result array with the path system is provided by Microsoft’s own webview installer and is used if no other webview is available.

Printers

This method returns a list of your printers.

js
var printers = Env.printers

will give you e.g.:

json
[
  {
    "name": "Brother MFC-L8690CDW series Printer",
    "capabilityDescriptions": ["Copies", "Color", "Duplex", "Collate"],
    "default": false,
    "network": false,
    "status": "Idle"
  },
  {
    "name": "Microsoft XPS Document Writer",
    "capabilityDescriptions": ["Copies", "Color", "Collate"],
    "default": false,
    "network": false,
    "status": "Idle"
  },
  {
    "name": "Microsoft Print to PDF",
    "capabilityDescriptions": ["Copies", "Color"],
    "default": true,
    "network": false,
    "status": "Idle"
  }
]