Function StatusbarGetText

  • Retrieves the text from a specified part of a status bar in a window. Note that the status bar parts use 1-based indexing.

    Parameters

    • windowTitle: string

      The title of the window containing the status bar.

    • windowText: string = ''

      Optional text found in the window.

    • part: number = 1

      The part of the status bar to retrieve text from (default is 1).

    • characterCount: number = 1024

      The maximum number of characters to retrieve (default is 1024).

    Returns string

    The text of the specified part of the status bar.

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

    // The first part of Notepad's status bar is empty
    const empty = StatusbarGetText('Untitled - Notepad', '', 1);
    const position = StatusbarGetText('Untitled - Notepad', '', 2);
    const zoom = StatusbarGetText('Untitled - Notepad', '', 3);
    const lingEndings = StatusbarGetText('Untitled - Notepad', '', 4);
    const encoding = StatusbarGetText('Untitled - Notepad', '', 5);

    console.log(empty) // ""
    console.log(position) // " Ln 1, Col 1"
    console.log(zoom) // " 100%"
    console.log(lingEndings) // " Windows (CRLF)"
    console.log(encoding) // " UTF-8"