Vocola.net
Vocola 3.1 Function Library
SwitchToApplication(applicationName, instance)
Namespaces LibraryTaskBar ► SwitchToApplication
Activates the window associated with the nth taskbar instance of a specified application.
Syntax
SwitchToApplication(applicationName, instance)
Parameters
applicationName
Name of a running application executable file, not including the .exe extension. Case insensitive.
instance
Which instance of specified application to activate, in taskbar order.
Remarks
Counts to instance number instance of applicationName (case insensitive) in the taskbar, and activates the window associated with that taskbar button. If too few instances are running, this function aborts the calling command and displays an error message in the Vocola Log window. It also errors out if the desired instance does not become active within 5 seconds.
Examples
CopySwitch to a particular taskbar item
<app> := ( Emacs
         | Notepad
         | Visual Studio  = devenv
         | Browser        = firefox
         | Command Prompt = cmd
         | Mailer         = thunderbird
         );
Use <app> 1..9 = SwitchToApplication($1, $2);
Saying For example "Use Browser 2" makes the call SwitchToApplication(firefox, 2), which activates the second instance of Firefox in the taskbar.

Assembly: VocolaFunctionLibrary (Module: VocolaFunctionLibrary) Version: 3.1.1.0 (3.1.1.0)