The commands in this section are responsible for assisting the user to select credentials for an app, emulate the user typing into the app and for injecting text into the controls of a window.
Instructs the Desktop Agent to find the most suitable bookmark credentials for the running application.
Default behaviour, with no caption matching, is to use a matching bookmark automatically if only one is found. If many are found then a credential selection dialog is shown to the user.
If an application is started by clicking on a web vault tile then it is assumed that the credentials of the clicked tile are to be used.
Optional
The bookmarkMatchOptions
are used to enable filtering on a user’s set of bookmarks for an app.
For example, the SAP GUI application is a single process that acts as a launcher to multiple connections. Using the bookmark matching feature makes it possible to associate a specific bookmark with a specific connection by comparing the text in a window’s caption or contained control.
If the user has many bookmarks for the SAP GUI app then without filtering they would be presented with a list of all bookmarks whether they were relevant for the selected target connection.
See the SAP GUI Application example for details.
The Caption
option refers to the text in the currently selected control (from a SelectControl command) or the caption text of the current window if no control is selected.
The stringMatch
controls how the filter text is compared to the window caption or control content. These are the same settings as the String Match Options
The bookmarkAttribute
option is the text to be compared against that found in the current window or control. This may be a String (Text) Literals or one of the following bookmark attributes:
bmAppArgument
bmAppPath
bmEnc1
bmEnc2
bmTitle
bmNotes
bmUsername
Optional
If the AlertUser
option is specified then the user is alerted via the notification pop-up if no bookmarks are found.
// Automatically injects credentials if vault launched
// or if only one bookmark stored for the app.
SelectBookmark
// Select a bookmark if the foreground window's
// caption matches the value in the bookmark's
// second encrypted value field.
SelectBookmark Caption StartsWith bmEnc2
See the SAP GUI Application example for a comprehensive example.
The SelectBookmark
command examines all the desktop bookmarks in the user’s vault that have the same Template as the running process. This identifies the set that are either presented to the user or subjected to subsequent filtering.
The InteractiveSelectBookmark
command displays a dialog box that allows the user to select a set of credentials and to have the username or password sent to a target field when the user clicks on a button in the dialog box.
The principle use case is with Flash or Java based websites where we cannot programmatically determine when the page is loaded. Using this command allows the user to tell the Desktop Agent when the target is ready for login.
Refer to the syntax diagrams for the valid combinations and positioning of the parameters.
Parameter | Shows Buttons | Description |
---|---|---|
| Send | The dialog only allows the user to select a user / password, the script controls injecting it into the target. |
| U (Inject Username) | Shows a button labelled “U” that will inject the username into the last field that the user clicked on. |
| P (Inject Password) | Shows a button labelled “P” that will inject the password into the last field that the user clicked on. |
| N/A | Only allows the text injection (by script or button) if the target window matches the |
| N/A | The text to display to the user on the pop up dialog box. |
SelectOnly
optionInteractiveSelectBookmark SelectOnly Restrict "Dedoose" "When the Dedoosse page is loaded, select the required user below, then click Send."
Presents the user with the following dialog box:
InjectUser
& InjectPassword
optionsInteractiveSelectBookmark InjectUser InjectPassword Restrict "Dedoose" "When the Dedoosse page is loaded, select the required user below, then click Send."
Presents the user with the following dialog box:
See the “Flash Based Website” example Flash\Java Website for a fully described example.
The SendKeys
command emulates user keyboard input by sending text to the script’s application’s top-most window.
This command attempts to bring the managed application’s window to the foreground prior to sending the text.
By default, if the script cannot confirm the application window is the foreground window then the text is not sent and a message is written to the log file. This may be overriden by the AnyWindow
option.
The syntax here is quite complicated but it allows for a full set of characters mixed in with special keys, e.g. simulating pressing control and S at the same time.
To specify multiple modifier keystrokes at the one time (i.e. holding down control and shift as well as a key) concatenate the modifiers with the plus sign. See the examples.
SendKeys
also understands how to emulate the user pressing a variety of special keys, such as Enter, Backspace, Caps Lock, Right Arrow, etc. These are listed in the Table of SendKeys Special Keys
Overrides checking that the current foreground window belongs to the script’s application.
This weakens security, but in some scenarios this is necessary (primarily when scripting Flash / Java browser appps).
This is literal text that is to be sent to the target app.
A modifier combination allows the script to send special key strokes such as pressing Control and S at the same time.
The supported modifiers are:
ALT
CTRL
SHIFT
The modifiers are used, along with the ‘+’ symbol, to create any combination of key presses.
To emulate the user pressing control plus S the following command would be used:
SendKeys CTRL+s
To send Shift plus Alt plus V use:
SendKeys SHIFT+ALT+v
This is any of the Bookmark & Template Attributes.
Note that these values are passed through literally, i.e. special key text (CTRL, etc.) are not converted in to the corresponding special key commands.
// Send a basic block of text
SendKeys "A string to be sent"
// Send a username, tab to the next control
// then send a password, then press Enter
SendKeys bmUsername TAB bmPassword ENTER
// To escape the double quote (") character
// just use it twice
SendKeys "Literal ""quotes"" here"
// Control, shift, alt and "m" all at the same time
SendKeys CTRL+SHIFT+ALT+m
SendKeys CTRL+SHIFT+ALT+ESCAPE
// Whitespace outside string constants is ignored
SendKeys "Text First" SHIFT+r ALT+x "Hello" CTRL+x
// Modifiers (SHIFT, ALT, CTRL) may be used on
// their own, not just as modifiers
SendKeys ALT ALT+x
The SendKeys
command is translated into the Windows SendKeys syntax. For in-depth information on the limitations of this approach see the following Microsoft article:
https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.sendkeys
Used to change the text of the currently selected windows control (via SelectControl) or the window’s caption if no control is selected.
Unlike SendKeys
the string parameter is passed unaltered to the target control. That is, the parameter is not sent to the application using Windows SendKeys.
SendKeys
emulates user input while SendText
is a low level write to a control that can be used to change the text on buttons, labels, etc.
This is the text to be sent to the selected control.
This may be composed of String (Text) Literals or Bookmark & Template Attributes.
// Change the text of the selected control
// to "Login to <bookmark's title>"
SendText "Login to " bmTitle
SendText
uses the Windows SENDTEXT message to write its text parameter to the window identified by the handle of the currently selected control (or current app’s window’s caption if no control selected).