Function ControlCommand

  • Sends a command to 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 send the command to.

    • command: Command

      The command to send to the control.

    • option: string = ''

      Optional additional parameter for the command.

    • characterCount: number = 1024

      The size of the buffer to store the result.

    Returns string

    The result of the command as a string.

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

    const result = ControlCommand('Untitled - Notepad', '', 'Edit1', 'IsVisible');

    console.log(result); // Output: "1" if visible, "0" otherwise