Vocola.net
Vocola 3.1 Function Library
WaitForWindow(windowTitleFragment)
Namespaces LibraryMain ► WaitForWindow
Pauses command execution until a specified window is the foreground window.
Syntax
WaitForWindow(windowTitleFragment)
Parameters
windowTitleFragment
All or part of the title of the desired window.
Remarks
Switching between windows is not instantaneous. When a command controls more than one window, use this function to pause until the window you want is the foreground window.

If within 5 seconds the foreground window title does not contain windowTitleFragment, this function aborts the calling command and displays an error message in the Vocola Log window.

Examples
CopyChange Notepad font size
Font Size 6..72 = {Alt+o}f WaitForWindow(font)
                  {Alt+s} $1 {Enter};
This command changes Notepad's font size. {Alt+o} opens the "Format" menu and f chooses the "Font..." option. WaitForWindow(font) waits for the font dialog to appear because the font dialog's title contains the word "font". Without this call the remaining keystrokes would be sent too quickly and the command would not work correctly.

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