Vocola.net
Vocola 3.1 Function Library
Touch(dx, dy, rectangleName)
Namespaces LibraryPointer ► Touch
Clicks the specified point, relative to a corner of the specified rectangle.
Syntax
Touch(dx, dy, rectangleName)
Parameters
dx
Horizontal offset in pixels from edge of specified rectangle. A positive number means the offset is relative to the left edge, while a negative number means the offset is relative to the right edge.
dy
Vertical offset in pixels from edge of specified rectangle. A positive number means the offset is relative to the top edge, while a negative number means the offset is relative to the bottom edge.
rectangleName
Name of rectangle from whose nearest corner dx and dy should be measured. Case insensitive. Choices:
  • Window - Current window's bounding rectangle, as with MoveTo(dx,dy).
  • WindowInner - Current window's inner rectangle (or "client area"), i.e., the part not occupied by the title bar, toolbars, etc.
  • Screen - Screen's bounding rectangle.
  • ScreenInner - Screen's inner rectangle (or "work area"), i.e., the part not occupied by the taskbar, docked windows, etc.
  • Screen2 - Bounding rectangle of a second screen, if present. Additional screens, if present, may be similarly referenced by number.
  • ScreenInner2 - Inner rectangle of a second screen, if present. Additional screens, if present, may be similarly referenced by number.
Remarks
This concise and useful function is equivalent to MoveTo followed by Click.

Using pixel coordinates to position the pointer is not the best way to control an application, but sometimes it's the only way.

Examples
CopySwitch to a Firefox tab by number
Tab 1..9 = Touch(-20, 145) Wait(100) {Down_$1}{Enter};
Firefox has no menu item or keyboard shortcut for switching to a particular tab. It does however have a drop down menu of available tabs at the right edge of the tab bar. Touch(-20, 145) clicks that menu (you may need to adjust the coordinates). Note that -20 specifies a horizontal offset in pixels from the right edge of the window. {Down_$1} moves to the desired tab in the menu, and {Enter} selects it.
See Also

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