Sometimes it can be difficult to automate some software for one of a few reasons:

  • Perhaps different fields share a common control ID.
  • Perhaps the GUI designer overlapped many controls, so AutoIt Window Info won’t show you the one that you actually have your mouse over.

This script aims to provide a solution.  The idea is for you to populate such a GUI with different values in each field, and then allow this script to “capture” that window.  It will then group controls sharing the same text values and display their ClassNameNNs, which is generally** an excellent way to reliably differentiate between controls.

Download: FindClassesByText.au3


  • Prepare the window that you wish to automate.
  • Start this script.
  • Click the Capture button.
  • Activate the other window by clicking on it.
  • Return to the script’s window and browse the assembled TreeView.

** Proven not to work with .NET applications; _ControlGetHandleByPos() may be your only hope there.

Download | Original AutoIt forum post