Function ControlGetText

  • Retrieves the text from a control in a window.

    Parameters

    • windowTitle: string

      The title of the window to access.

    • windowText: string

      Optional text found in the window.

    • controlId: string

      The ID of the control to retrieve text from.

    • characterCount: number = 1024

      The maximum number of characters to retrieve. Default is 1024.

    Returns string

    The text of the control.

    import { ControlGetText } from '@ahmic/autoit-js';

    const text = ControlGetText('Untitled - Notepad', '', 'Edit1');

    console.log(text); // Output: "Sample text"