Skip to main content

Fluency Direct with VBScript

It is possible to determine the parameter and return value data types for all functions and methods below by using the intelli-sense in the Fluency Direct Script Editor.

Category

Feature/Keyword

Content Insertion

fd.KeyPress - simulate key-presses

fd.InsertText - Insert a block of text

Microphone

fd.CompatbilityExtensions.SetMicrophone - Turns the microphone on or off.

fd.CompatbilityExtensions.GoToSleep - Activates sleep mode and sleep mode vocabulary which typically includes only the Wake Up command.

fd.CompatbilityExtensions.WakeUp - Exits sleep mode and wakes up the microphone.

Playback Audio

fd.CompatbilityExtensions.Beep - Generates a default beep sound on windows.

fd.CompatbilityExtensions.PlaySound - Plays a specified sound file. This command will turn the microphone off during sound play. The next command will execute when the sound file ends.

fd.CompatbilityExtensions.TTSPlayString - Converts text to speech. This command sets microphone to off if it is on.

Window / Control Manipulation

fd.GetActiveWindowTitle - Get the title of the active window

fd.WindowAction - maximize, minimize, activate, or close a window

fd.MouseAction - Click a location on a window

fd.Wait - wait for a number of seconds

fd.WaitForWindow - Suspends execution of the script until the correct title appears in time in the foreground. Setting Third parameter to true terminates the command if the window with correct title does not appear in time.

fd.GetAppWindowData - Details about the current target application.

fd.GetAutomationUtils.GetAutomationElement - Returns a new automation element with no focus. See UI Automation Overview.

fd.GetAutomationUtils.GetTopWindowAutomationElement - Returns an automation element representing the top window.

fd.GetAutomationUtils.GetFocusWindowAutomationElement - Returns an automation element representing the focused window.

fd.GetAutomationUtils.GetAutomationElementFromHandle - Returns an automation element representing the supplied handle.

Window / Control Targeting

fd.SetTargetWindow (int windowHandle) - Sets the dictation control's target to the window with the specified handle. An exception is thrown if dictation control doesn't support setting the specified window as a target. All dictation and commands will be directed towards the target while it is set. The only exception to this is dictation and commands for dialogs that are raised from the target such as when performing corrections or creating text snippets.

fd.SetTargetWindow2 (int windowHandle, string controlId) - Sets the dictation control's target to the window with the specified handle and control with the specified Id. The control Id is an application specific identifier, such as an element Id for a textarea element in IE. An exception is thrown if dictation control doesn't support setting the specified window as a target. All dictation and commands will be directed towards the target while it is set. The only exception to this is dictation and commands for dialogs that are raised from the target such as when performing corrections or creating text snippets.

fd.SetTargetWindow3 (int windowHandle, string controlId, string targetDescription) - Set a window to be the dictation target for FD.

fd.CompatbilityExtensions.ControlPick - Sends a mouse click command to a given control. This works only on Windows standard controls.

fd.CompatbilityExtensions.ButtonClick - Initiates a single or double click with the specified (right, left, center) mouse button.

Text Manipulation

fd.TextFieldUtils.GetAllText - Gets all text that FD has scraped from the current text field.

fd.BuiltInCommand - call a built in voice command from a script

Subroutines

fd.Sleep (int millisecondsTimeout)

fd.WriteLineToLog(string message)

fd.DebugOutput - Write a log line to the Fluency Direct Activity Window. The Activity Window can be used for debugging script execution.

fd.CreateTimer - creates a timer for executing a method on a thread at specific intervals

fd.GetNative - Get Native Win32 methods

fd.ExecuteMethodOnLibrary - Execute a method on a loaded DLL (see Load Library)

fd.ExitCommand - Immediately Exit the command from executing

Browser Support (IE, Chrome and Firefox)

fd.GetWebScriptingUtils.ProcId - The process ID for the current target.

fd.GetWebScriptingUtils.GetHtmlElementForWindow - Returns a WebElement for the current target window's html element.

fd.GetWebScriptingUtils.GetBodyElementForWindow - Returns a WebElement for the current target window's body element.

fd.GetWebScriptingUtils.ExecuteFunction - Execute a function on the current target window.

fd.GetWebScriptingUtils.SetProcId - Sets process ID for the current target.

fd.GetWebScriptingUtils.GetJsonObject - Returns an object from the current target's window object.

fd.GetWebScriptingUtils.ExecuteFunctionOnObject - Executes a function on the object from the current target's window object.

fd.GetInternetExplorerUtils.GetMainDocument - Returns an IHTMLDocument2 object for the main document.

fd.GetInternetExplorerUtils.GetDocument - Returns an IHTMLDocument2 object for the specified frame name.

DragonScript Compatibility

Programming interfaces used by DragonScript to extend VBA. Much of this Functionality is available via Fluency Direct's scripting extensions elsewhere, but these are helper functions that make it easier to convert scripting code originally written for Dragon Medical.

fd.CompatbilityExtensions.ActiveControlPick - Selects an application control that supports Microsoft Active Accessibility. This method is currently not supported in FD.

fd.CompatbilityExtensions.ActiveMenuPick - Selects the specified menu or menu item, visible in the active window, by executing the menu's access keys. This command works only in applications that support Microsoft Active Accessibility. This method is currently not supported in FD.

fd.CompatbilityExtensions.AppBringUp - Will start the specified application, or reactivate the application if it is already running.

fd.CompatbilityExtensions.AppSwapWith - Switches the active application to the specified application. If the specified application if it is not running, it will start it.

fd.CompatbilityExtensions.AppActivate - Switches the active application to the specified application.

fd.CompatbilityExtensions.Beep - Generates a default beep sound on windows.

fd.CompatbilityExtensions.ButtonClick - Initiates a single or double click with the specified (right, left, center) mouse button.

fd.CompatbilityExtensions.ClearDesktop - Minimizes all open applications.

fd.CompatbilityExtensions.ControlPick - Sends a mouse click command to a given control. This works only on Windows standard controls.

fd.CompatbilityExtensions.DragToPoint - Must have an established RememberPoint position! This method will move to thelast RememberPoint position, hold the mouse button, and move to the current pointer position.

fd.CompatbilityExtensions.GoToSleep - Activates sleep mode and sleep mode vocabulary which typically includes only the Wake Up command.

fd.CompatbilityExtensions.HeardWord - Causes FD to behave as if the specified word, word sequence, or voice command were received by the recognizer.

fd.CompatbilityExtensions.MsgBoxConfirm - Displays a standard Windows message box with the specified attributes.

fd.CompatbilityExtensions.PlaySound - Plays a specified sound file. This command will turn the microphone off during sound play. The next command will execute when the sound file ends.

fd.CompatbilityExtensions.RememberPoint - Records the current mouse pointer position. Use this command to record a starting point position before you using the DragToPoint command.

fd.CompatbilityExtensions.SendKeys - Sends keystrokes to the active window.

fd.CompatbilityExtensions.SetMicrophone - Turns the microphone on or off.

fd.CompatbilityExtensions.SetMousePosition - Positions the mouse pointer using absolute or relative coordinates. Can be used to position the mouse for selecting objects that do not have accelerator keys and that do not change position.

fd.CompatbilityExtensions.TTSPlayString - Converts text to speech. This command sets microphone to off if it is on.

fd.CompatbilityExtensions.WaitForWindow - Suspends execution of the script until the correct title appears in time in the foreground. Setting Thrid parameter to true terminates the command if the window with correct title does not appear in time.

fd.CompatbilityExtensions.Wait - Specify wait for a number of seconds.

fd.CompatbilityExtensions.WakeUp - Exits sleep mode and wakes up the microphone.

Variables and State Tracking

fd.Variables.Keys - An array of all variable names. Variables can be shared across Command Action Steps.

fd.Variables.HasKey - Whether the specific variable is in the dictionary. Variables can be shared across Command Action Steps.

fd.Variables.GetValue - Returns the value for a specific variable. Variables can be shared across Command Action Steps.

fd.Variables.SetValue - Either updates an existing variables value or creates a new variable. These variables are readable by subsequent actions in this command sequence. Variables can be shared across Command Action Steps.

fd.GetDataSet - Helper functions for reading Datasets. Datasets can be defined by users or administrators and are shared across running instances of Fluency Direct.

fd.GetApplicationState - Returns EMR data. The application state object has information about patient context.

fd.ResetApplicationState - Resets EMR state.

fd.Result.GetParameter (string ParamtersName) - The value for a parameterized portion of a recognized grammar that triggered the current command. Calls for parameters are not valid for commands that are not defined via parametrized grammars.

fd.Result.ToString - The recognized text which triggered the currently running command.

AutoIt HelperFunctions

AutoIT is a code library that uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and Javascript). You can gain access to the AutoItX functions via fd.GetAutoIt().