Async API

The async API is mostly identical to the sync API.

AsyncFutureResult

class ahk._async.transport.AsyncFutureResult(task)[source]
Parameters:

task (Task[TypeVar(T_AsyncFuture)]) –

__init__(task)[source]
Parameters:

task (Task[TypeVar(T_AsyncFuture)]) –

async result()[source]
Return type:

TypeVar(T_AsyncFuture)

AsyncWindow

class ahk._async.window.AsyncWindow(engine, ahk_id)[source]
Parameters:
  • engine (AsyncAHK[TypeVar(T_EngineVersion, bound= Optional[Literal['v1', 'v2']])]) –

  • ahk_id (str) –

__init__(engine, ahk_id)[source]
Parameters:
  • engine (AsyncAHK[TypeVar(T_EngineVersion, bound= Optional[Literal['v1', 'v2']])]) –

  • ahk_id (str) –

async close()[source]
Return type:

None

async kill()[source]
Return type:

None

async exists()[source]
Return type:

bool

property id: str
property exist: Coroutine[None, None, bool]
async get_pid()[source]
Return type:

int

property pid: Coroutine[None, None, int]
async get_process_name()[source]
Return type:

str

property process_name: Coroutine[None, None, str]
async get_process_path()[source]
Return type:

str

property process_path: Coroutine[None, None, str]
async get_minmax()[source]
Return type:

int

async get_title()[source]
Return type:

str

property title: Coroutine[None, None, str]
async set_title(new_title)[source]
Parameters:

new_title (str) –

Return type:

None

async list_controls()[source]
Return type:

Sequence[AsyncControl]

async minimize(blocking=True)[source]
Parameters:

blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async maximize(blocking=True)[source]
Parameters:

blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async restore(blocking=True)[source]
Parameters:

blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async get_class(blocking=True)[source]
Parameters:

blocking (bool) –

Return type:

Union[str, AsyncFutureResult[str]]

async set_always_on_top(toggle, *, blocking=True)[source]
Parameters:
  • toggle (Literal['On', 'Off', 'Toggle', 1, -1, 0]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async is_always_on_top(*, blocking=True)[source]
Parameters:

blocking (bool) –

Return type:

Union[bool, AsyncFutureResult[Optional[bool]]]

property always_on_top: Coroutine[None, None, bool]
async send(keys, control='', *, blocking=True)[source]
Parameters:
  • keys (str) –

  • control (str) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async click(x=0, y=0, *, button='L', click_count=1, options='', blocking=True)[source]
Parameters:
  • x (int) –

  • y (int) –

  • button (Literal['L', 'R', 'M', 'LEFT', 'RIGHT', 'MIDDLE']) –

  • click_count (int) –

  • options (str) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async get_text(*, blocking=True)[source]
Parameters:

blocking (bool) –

Return type:

Union[str, AsyncFutureResult[str]]

property text: Coroutine[None, None, str]
async get_position(*, blocking=True)[source]
Parameters:

blocking (bool) –

Return type:

Union[Position, AsyncFutureResult[Optional[Position]], AsyncFutureResult[Position]]

async activate(*, blocking=True)[source]
Parameters:

blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async to_bottom(*, blocking=True)[source]
Parameters:

blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async to_top(*, blocking=True)[source]
Parameters:

blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async show(*, blocking=True)[source]
Parameters:

blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async hide(*, blocking=True)[source]
Parameters:

blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async disable(*, blocking=True)[source]
Parameters:

blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async enable(*, blocking=True)[source]
Parameters:

blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async redraw(*, blocking=True)[source]
Parameters:

blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async set_style(style, *, blocking=True)[source]
Parameters:
  • style (str) –

  • blocking (bool) –

Return type:

Union[bool, AsyncFutureResult[bool]]

async set_ex_style(style, *, blocking=True)[source]
Parameters:
  • style (str) –

  • blocking (bool) –

Return type:

Union[bool, AsyncFutureResult[bool]]

async set_region(options, *, blocking=True)[source]
Parameters:
  • options (str) –

  • blocking (bool) –

Return type:

Union[bool, AsyncFutureResult[bool]]

async set_transparent(transparency, *, blocking=True)[source]
Parameters:
  • transparency (Union[int, Literal['Off']]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async set_trans_color(color, *, blocking=True)[source]
Parameters:
  • color (Union[int, str]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

property active: Coroutine[None, None, bool]
async is_active()[source]
Return type:

bool

async move(x, y, *, width=None, height=None, blocking=True)[source]
Parameters:
  • x (int) –

  • y (int) –

  • width (Optional[int]) –

  • height (Optional[int]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async classmethod from_pid(engine, pid)[source]
Parameters:
  • engine (AsyncAHK[Any]) –

  • pid (int) –

Return type:

Optional[AsyncWindow]

async classmethod from_mouse_position(engine)[source]
Parameters:

engine (AsyncAHK[Any]) –

Return type:

Optional[AsyncWindow]

AsyncControl

class ahk._async.window.AsyncControl(window, hwnd, control_class)[source]
Parameters:
  • window (AsyncWindow) –

  • hwnd (str) –

  • control_class (str) –

__init__(window, hwnd, control_class)[source]
Parameters:
  • window (AsyncWindow) –

  • hwnd (str) –

  • control_class (str) –

async click(*, button='L', click_count=1, options='', use_hwnd=None, blocking=True)[source]
Parameters:
  • button (Literal['L', 'R', 'M', 'LEFT', 'RIGHT', 'MIDDLE']) –

  • click_count (int) –

  • options (str) –

  • use_hwnd (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async send(keys, *, use_hwnd=None, blocking=True)[source]
Parameters:
  • keys (str) –

  • use_hwnd (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async get_text(*, use_hwnd=None, blocking=True)[source]
Parameters:
  • use_hwnd (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[str, AsyncFutureResult[str]]

async get_position(*, use_hwnd=None, blocking=True)[source]
Parameters:
  • use_hwnd (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[Position, AsyncFutureResult[Position]]

AsyncAHK

class ahk._async.engine.AsyncAHK(*, TransportClass: Type[AsyncTransport] | None = None, directives: list[Union[ahk.directives.Directive, Type[ahk.directives.Directive]]] | None = None, executable_path: str = '', extensions: list[ahk.extensions.Extension] | None | Literal['auto'] = None)[source]
class ahk._async.engine.AsyncAHK(*, TransportClass: Type[AsyncTransport] | None = None, directives: list[Union[ahk.directives.Directive, Type[ahk.directives.Directive]]] | None = None, executable_path: str = '', extensions: list[ahk.extensions.Extension] | None | Literal['auto'] = None, version: None)
class ahk._async.engine.AsyncAHK(*, TransportClass: Type[AsyncTransport] | None = None, directives: list[Union[ahk.directives.Directive, Type[ahk.directives.Directive]]] | None = None, executable_path: str = '', extensions: list[ahk.extensions.Extension] | None | Literal['auto'] = None, version: Literal['v2'])
class ahk._async.engine.AsyncAHK(*, TransportClass: Type[AsyncTransport] | None = None, directives: list[Union[ahk.directives.Directive, Type[ahk.directives.Directive]]] | None = None, executable_path: str = '', extensions: list[ahk.extensions.Extension] | None | Literal['auto'] = None, version: Literal['v1'])
Parameters:
  • self (AsyncAHK[Optional[Literal['v1', 'v2']]]) –

  • TransportClass (Optional[Type[AsyncTransport]]) –

  • directives (Optional[list[Union[Directive, Type[Directive]]]]) –

  • executable_path (str) –

  • extensions (Union[list[Extension], None, Literal['auto']]) –

  • version (Optional[Literal['v1', 'v2']]) –

__init__(*, TransportClass=None, directives=None, executable_path='', extensions=None, version=None)[source]
Parameters:
  • self (AsyncAHK[Optional[Literal['v1', 'v2']]]) –

  • TransportClass (Optional[Type[AsyncTransport]]) –

  • directives (Optional[list[Union[Directive, Type[Directive]]]]) –

  • executable_path (str) –

  • extensions (Union[list[Extension], None, Literal['auto']]) –

  • version (Optional[Literal['v1', 'v2']]) –

add_hotkey(keyname, callback, ex_handler=None)[source]

Register a function to be called when a hotkey is pressed.

Key notes:

  • You must call the start_hotkeys method for the hotkeys to be active

  • All hotkeys run in a single AHK process instance (but Python callbacks also get their own thread and can run simultaneously)

  • If you add a hotkey after the hotkey thread/instance is active, it will be restarted automatically

  • async functions are not directly supported as callbacks, however you may write a synchronous function that calls asyncio.run/loop.create_task etc.

Parameters:
  • keyname (str) – the key trigger for the hotkey, such as #n (win+n)

  • callback (Callable[[], Any]) – callback function to call when the hotkey is triggered

  • ex_handler (Optional[Callable[[str, Exception], Any]]) – a function which accepts two parameters: the keyname for the hotkey and the exception raised by the callback function.

Return type:

None

Returns:

async function_call(function_name, args=None, blocking=True)[source]

Call an AHK function defined in the daemon script. This method is intended for use by extension authors.

Parameters:
  • function_name (str) –

  • args (Optional[list[str]]) –

  • blocking (bool) –

Return type:

Any

add_hotstring(trigger, replacement_or_callback, ex_handler=None, options='')[source]

Register a hotstring, e.g., ::btw::by the way

Key notes:

  • You must call the start_hotkeys method for registered hotstrings to be active

  • All hotstrings (and hotkeys) run in a single AHK process instance separate from other AHK processes.

Parameters:
  • trigger (str) – the trigger phrase for the hotstring, e.g., btw

  • replacement_or_callback (Union[str, Callable[[], Any]]) – the replacement phrase (e.g., by the way) or a Python callable to execute in response to the hotstring trigger

  • ex_handler (Optional[Callable[[str, Exception], Any]]) – a function which accepts two parameters: the hotstring and the exception raised by the callback function.

  • options (str) – the hotstring options – same meanings as in AutoHotkey.

Return type:

None

Returns:

remove_hotkey(keyname)[source]
Parameters:

keyname (str) –

Return type:

None

clear_hotkeys()[source]
Return type:

None

remove_hotstring(trigger)[source]
Parameters:

trigger (str) –

Return type:

None

clear_hotstrings()[source]
Return type:

None

async set_title_match_mode(title_match_mode, /)[source]

Sets the default title match mode

Does not affect methods called with blocking=True (because these run in a separate AHK process)

Reference: https://www.autohotkey.com/docs/commands/SetTitleMatchMode.htm

Parameters:

title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) – the match mode (and/or match speed) to set as the default title match mode. Can be 1, 2, 3, ‘Regex’, ‘Fast’, ‘Slow’ or a tuple of these.

Return type:

None

Returns:

None

async get_title_match_mode()[source]

Get the title match mode.

I.E. the current value of A_TitleMatchMode

Return type:

str

async get_title_match_speed()[source]

Get the title match mode speed.

I.E. the current value of A_TitleMatchModeSpeed

Return type:

str

async set_coord_mode(target, relative_to='Screen')[source]

Analog of CoordMode

Parameters:
  • target (Union[Literal['ToolTip'], Literal['Pixel'], Literal['Mouse'], Literal['Caret'], Literal['Menu']]) –

  • relative_to (Literal['Screen', 'Relative', 'Window', 'Client', '']) –

Return type:

None

async get_coord_mode(target)[source]

Analog for A_CoordMode<target>

Parameters:

target (Union[Literal['ToolTip'], Literal['Pixel'], Literal['Mouse'], Literal['Caret'], Literal['Menu']]) –

Return type:

str

async set_send_mode(mode)[source]

Analog for SendMode

Parameters:

mode (Literal['Event', 'Input', 'InputThenPlay', 'Play', '']) –

Return type:

None

async get_send_mode()[source]
Return type:

str

async control_click(button='L', click_count=1, options='', control='', title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for ControlClick

Parameters:
  • button (Literal['L', 'R', 'M', 'LEFT', 'RIGHT', 'MIDDLE']) –

  • click_count (int) –

  • options (str) –

  • control (str) –

  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async control_get_text(*, control='', title='', text='', exclude_title='', exclude_text='', title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for ControlGetText

Parameters:
  • control (str) –

  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[str, AsyncFutureResult[str]]

async control_get_position(control='', title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog to ControlGetPos

Parameters:
  • control (str) –

  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[Position, AsyncFutureResult[Position]]

async control_send(keys, control='', title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for ControlSend

Parameters:
  • keys (str) –

  • control (str) –

  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

start_hotkeys()[source]

Start the Autohotkey process for triggering hotkeys

Return type:

None

stop_hotkeys()[source]

Stop the Autohotkey process for triggering hotkeys/hotstrings

Return type:

None

async set_detect_hidden_windows(value)[source]

Analog for DetectHiddenWindows

Parameters:

value (bool) – The setting value. True to turn on hidden window detection, False to turn it off.

Return type:

None

async list_windows(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Enumerate all windows matching the criteria.

Analog for WinGet List subcommand <https://www.autohotkey.com/docs/v1/lib/WinGet.htm#List>_

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[List[AsyncWindow], AsyncFutureResult[List[AsyncWindow]]]

async get_mouse_position(coord_mode=None, *, blocking=True)[source]

Analog for MouseGetPos

Parameters:
  • coord_mode (Optional[Literal['Screen', 'Relative', 'Window', 'Client', '']]) –

  • blocking (bool) –

Return type:

Union[Coordinates, AsyncFutureResult[Coordinates]]

property mouse_position: Coroutine[None, None, Coordinates]

Convenience property for get_mouse_position()

Setter accepts a tuple of x,y coordinates passed to mouse_mouse()

async mouse_move(x=None, y=None, *, speed=None, relative=False, send_mode=None, blocking=True)[source]

Analog for MouseMove

Parameters:
  • x (Union[str, int, None]) –

  • y (Union[str, int, None]) –

  • speed (Optional[int]) –

  • relative (bool) –

  • send_mode (Optional[Literal['Event', 'Input', 'InputThenPlay', 'Play', '']]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async a_run_script(*args, **kwargs)[source]

Deprecated. Use run_script() instead.

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Union[str, AsyncFutureResult[str]]

async get_active_window(blocking=True)[source]

Gets the currently active window.

Parameters:
  • self (AsyncAHK[Any]) –

  • blocking (bool) –

Return type:

Union[AsyncWindow, None, AsyncFutureResult[Optional[AsyncWindow]], AsyncFutureResult[AsyncWindow]]

property active_window: Coroutine[None, None, AsyncWindow | None]

Gets the currently active window. Convenience property for get_active_window()

async find_windows(func=None, *, title_match_mode=None, title='', text='', exclude_title='', exclude_text='', exact=None)[source]
Parameters:
  • func (Optional[Callable[[AsyncWindow], Awaitable[bool]]]) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • exact (Optional[bool]) –

Return type:

List[AsyncWindow]

async find_windows_by_class(class_name, *, exact=None, title_match_mode=None)[source]
Parameters:
  • class_name (str) –

  • exact (Optional[bool]) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

Return type:

List[AsyncWindow]

async find_windows_by_text(text, exact=None, title_match_mode=None)[source]
Parameters:
  • text (str) –

  • exact (Optional[bool]) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

Return type:

List[AsyncWindow]

async find_windows_by_title(title, exact=None, title_match_mode=None)[source]
Parameters:
  • title (str) –

  • exact (Optional[bool]) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

Return type:

List[AsyncWindow]

async find_window(func=None, *, title_match_mode=None, title='', text='', exclude_title='', exclude_text='', exact=None)[source]
Parameters:
  • func (Optional[Callable[[AsyncWindow], Awaitable[bool]]]) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • exact (Optional[bool]) –

Return type:

Optional[AsyncWindow]

async find_window_by_class(class_name, exact=None, title_match_mode=None)[source]
Parameters:
  • class_name (str) –

  • exact (Optional[bool]) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

Return type:

Optional[AsyncWindow]

async find_window_by_text(text, exact=None, title_match_mode=None)[source]
Parameters:
  • text (str) –

  • exact (Optional[bool]) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

Return type:

Optional[AsyncWindow]

async find_window_by_title(title, exact=None, title_match_mode=None)[source]
Parameters:
  • title (str) –

  • exact (Optional[bool]) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

Return type:

Optional[AsyncWindow]

async get_volume(device_number=1)[source]

Analog for SoundGetWaveVolume

Parameters:

device_number (int) –

Return type:

float

async key_down(key, *, blocking=True)[source]

Shortcut for send_input() but transforms specified key to perform a key “DOWN” only (no release)

Parameters:
  • key (Union[str, Key]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async key_press(key, *, release=True, blocking=True)[source]

Press (and release) a key. Sends :py:meth:`key_down then, if release is True (the default), sends key_up() subsequently.

Parameters:
  • key (Union[str, Key]) –

  • release (bool) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async key_release(key, *, blocking=True)[source]

Alias for key_up()

Parameters:
  • key (Union[str, Key]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async key_state(key_name, *, mode=None, blocking=True)[source]

Analog for GetKeyState

Parameters:
  • key_name (str) –

  • mode (Optional[Literal['T', 'P']]) –

  • blocking (bool) –

Return type:

Union[int, float, str, None, AsyncFutureResult[str], AsyncFutureResult[int], AsyncFutureResult[float], AsyncFutureResult[None]]

async key_up(key, blocking=True)[source]

Shortcut for send_input() but transforms specified key to perform a key “UP” only. Useful if the key was previously pressed down but not released.

Parameters:
  • key (Union[str, Key]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async key_wait(key_name, *, timeout=None, logical_state=False, released=False, blocking=True)[source]

Analog for KeyWait

Parameters:
  • key_name (str) –

  • timeout (Optional[int]) –

  • logical_state (bool) –

  • released (bool) –

  • blocking (bool) –

Return type:

Union[bool, AsyncFutureResult[bool]]

async run_script(script_text_or_path, /, *, blocking=True, timeout=None)[source]

Run an AutoHotkey script. Can either be a path to a script (.ahk) file or a string containing script contents

Parameters:
  • script_text_or_path (str) –

  • blocking (bool) –

  • timeout (Optional[int]) –

Return type:

Union[str, AsyncFutureResult[str]]

async set_send_level(level)[source]

Analog for SendLevel

Parameters:

level (int) –

Return type:

None

async get_send_level()[source]

Get the current SendLevel (I.E. the value of A_SendLevel)

Return type:

int

async send(s, *, raw=False, key_delay=None, key_press_duration=None, send_mode=None, blocking=True)[source]

Analog for Send

Parameters:
  • s (str) –

  • raw (bool) –

  • key_delay (Optional[int]) –

  • key_press_duration (Optional[int]) –

  • send_mode (Optional[Literal['Event', 'Input', 'InputThenPlay', 'Play', '']]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async send_raw(s, *, key_delay=None, key_press_duration=None, blocking=True)[source]

Analog for SendRaw

Parameters:
  • s (str) –

  • key_delay (Optional[int]) –

  • key_press_duration (Optional[int]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async send_input(s, *, blocking=True)[source]

Analog for SendInput

Parameters:
  • s (str) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async type(s, *, blocking=True)[source]

Like send_input() but performs necessary escapes for you.

Parameters:
  • s (str) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async send_play(s, *, key_delay=None, key_press_duration=None, blocking=True)[source]

Analog for SendPlay

Parameters:
  • s (str) –

  • key_delay (Optional[int]) –

  • key_press_duration (Optional[int]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async set_capslock_state(state=None, *, blocking=True)[source]

Analog for SetCapsLockState

Parameters:
  • state (Optional[Literal[0, 1, 'On', 'Off', 'AlwaysOn', 'AlwaysOff']]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async set_volume(value, device_number=1, *, blocking=True)[source]

Analog for SoundSetWaveVolume

Parameters:
  • value (int) –

  • device_number (int) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async show_traytip(title, text, second=None, type_id=1, *, silent=False, large_icon=False, blocking=True)[source]

Analog for TrayTip

Parameters:
  • title (str) –

  • text (str) –

  • second (Optional[float]) –

  • type_id (int) –

  • silent (bool) –

  • large_icon (bool) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async show_error_traytip(title, text, second=None, *, silent=False, large_icon=False, blocking=True)[source]

Convenience method for show_traytip() for error-style messages

Parameters:
  • self (AsyncAHK[Any]) –

  • title (str) –

  • text (str) –

  • second (Optional[float]) –

  • silent (bool) –

  • large_icon (bool) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async show_info_traytip(title, text, second=None, *, silent=False, large_icon=False, blocking=True)[source]

Convenience method for show_traytip() for info-style messages

Parameters:
  • self (AsyncAHK[Any]) –

  • title (str) –

  • text (str) –

  • second (Optional[float]) –

  • silent (bool) –

  • large_icon (bool) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async show_warning_traytip(title, text, second=None, *, silent=False, large_icon=False, blocking=True)[source]

Convenience method for show_traytip() for warning-style messages

Parameters:
  • self (AsyncAHK[Any]) –

  • title (str) –

  • text (str) –

  • second (Optional[float]) –

  • silent (bool) –

  • large_icon (bool) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async show_tooltip(text='', x=None, y=None, which=1)[source]

Analog for ToolTip

Parameters:
  • text (str) –

  • x (Optional[int]) –

  • y (Optional[int]) –

  • which (int) –

Return type:

None

async hide_tooltip(which=1)[source]
Parameters:

which (int) –

Return type:

None

async menu_tray_tooltip(value)[source]

Change the menu tray icon tooltip that appears when hovering the mouse over the tray icon. Does not affect tray icon for AHK processes started with run_script() or blocking=False

Uses the Tip subcommand

Parameters:

value (str) –

Return type:

None

async menu_tray_icon(filename='*', icon_number=1, freeze=None)[source]

Change the tray icon menu. Does not affect tray icon for AHK processes started with run_script() or blocking=False

Uses the Icon subcommand

If called with no parameters, the tray icon will be reset to the original default.

Parameters:
  • filename (str) –

  • icon_number (int) –

  • freeze (Optional[bool]) –

Return type:

None

async menu_tray_icon_show()[source]

Show (‘unhide’) the tray icon previously hidden by NoTrayIcon directive. Does not affect tray icon for AHK processes started with run_script() or blocking=False

Return type:

None

async menu_tray_icon_hide()[source]

hides the tray icon. Does not affect tray icon for AHK processes started with run_script() or blocking=False

Return type:

None

async sound_beep(frequency=523, duration=150, *, blocking=True)[source]

Analog for SoundBeep

Parameters:
  • frequency (int) –

  • duration (int) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async sound_get(device_number=1, component_type='MASTER', control_type='VOLUME', *, blocking=True)[source]

Analog for SoundGet

Parameters:
  • device_number (int) –

  • component_type (str) –

  • control_type (str) –

  • blocking (bool) –

Return type:

Union[str, AsyncFutureResult[str]]

async sound_play(filename, *, blocking=True)[source]

Analog for SoundPlay

Parameters:
  • filename (str) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async sound_set(value, device_number=1, component_type='MASTER', control_type='VOLUME', *, blocking=True)[source]

Analog for SoundSet

Parameters:
  • value (Union[str, int, float]) –

  • device_number (int) –

  • component_type (str) –

  • control_type (str) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async win_get(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for WinGet

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[AsyncWindow, None, AsyncFutureResult[Optional[AsyncWindow]], AsyncFutureResult[AsyncWindow]]

async win_get_text(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]
Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[str, AsyncFutureResult[str]]

async win_get_title(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]
Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[str, AsyncFutureResult[str]]

async win_get_class(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for WinGetClass

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[str, AsyncFutureResult[str]]

async win_get_position(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for WinGetPos

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[Position, None, AsyncFutureResult[Optional[Position]], AsyncFutureResult[Position]]

async win_get_idlast(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Like the IDLast subcommand for WinGet

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[AsyncWindow, None, AsyncFutureResult[Optional[AsyncWindow]]]

async win_get_pid(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Get a window by process ID.

Like the pid subcommand for WinGet

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[int, None, AsyncFutureResult[Optional[int]]]

async win_get_process_name(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Get the process name of a window

Analog for ProcessName subcommand for WinGet

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[None, str, AsyncFutureResult[Optional[str]]]

async win_get_process_path(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Get the process path for a window.

Analog for the ProcessPath subcommand for WinGet

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[str, None, AsyncFutureResult[Optional[str]]]

async win_get_count(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for the Count subcommand for WinGet

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[int, AsyncFutureResult[int]]

async win_get_minmax(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for the MinMax subcommand for WinGet

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[None, int, AsyncFutureResult[Optional[int]]]

async win_get_control_list(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for the ControlList subcommand for WinGet

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[List[AsyncControl], None, AsyncFutureResult[Optional[List[AsyncControl]]]]

async win_get_from_mouse_position(*, blocking=True)[source]
Parameters:

blocking (bool) –

Return type:

Union[AsyncWindow, None, AsyncFutureResult[Optional[AsyncWindow]]]

async win_exists(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]
Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[bool, AsyncFutureResult[bool]]

async win_activate(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for WinActivate

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async win_set_title(new_title, title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for WinSetTitle

Parameters:
  • new_title (str) –

  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async win_set_always_on_top(toggle, title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for AlwaysOnTop subcommand of WinSet

Parameters:
  • toggle (Literal['On', 'Off', 'Toggle', 1, -1, 0]) –

  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async win_set_bottom(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for Bottom subcommand of WinSet

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async win_set_top(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for Top subcommand of WinSet

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async win_set_disable(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for Disable subcommand of WinSet

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async win_set_enable(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for Enable subcommand of WinSet

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async win_set_redraw(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for Redraw subcommand of WinSet

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async win_set_style(style, title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for Style subcommand of WinSet

Parameters:
  • style (str) –

  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[bool, AsyncFutureResult[bool]]

async win_set_ex_style(style, title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for ExStyle subcommand of WinSet

Parameters:
  • style (str) –

  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[bool, AsyncFutureResult[bool]]

async win_set_region(options, title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for Region subcommand of WinSet

Parameters:
  • options (str) –

  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[bool, AsyncFutureResult[bool]]

async win_set_transparent(transparency, title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for Transparent subcommand of WinSet

Parameters:
  • transparency (Union[int, Literal['Off']]) –

  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async win_set_trans_color(color, title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for TransColor subcommand of WinSet

Parameters:
  • color (Union[int, str]) –

  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async windows(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)

Enumerate all windows matching the criteria.

Analog for WinGet List subcommand <https://www.autohotkey.com/docs/v1/lib/WinGet.htm#List>_

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[List[AsyncWindow], AsyncFutureResult[List[AsyncWindow]]]

async right_click(x=None, y=None, click_count=None, direction=None, *, relative=None, blocking=True, coord_mode=None, send_mode=None)[source]
Parameters:
  • x (Union[int, Tuple[int, int], None]) –

  • y (Optional[int]) –

  • click_count (Optional[int]) –

  • direction (Optional[Literal['U', 'D', 'Up', 'Down']]) –

  • relative (Optional[bool]) –

  • blocking (bool) –

  • coord_mode (Optional[Literal['Screen', 'Relative', 'Window', 'Client', '']]) –

  • send_mode (Optional[Literal['Event', 'Input', 'InputThenPlay', 'Play', '']]) –

Return type:

Optional[AsyncFutureResult[None]]

async click(x=None, y=None, button=None, click_count=None, direction=None, *, relative=None, blocking=True, coord_mode=None, send_mode=None)[source]

Analog for Click

Parameters:
  • x (Union[int, Tuple[int, int], None]) –

  • y (Optional[int]) –

  • button (Union[int, Literal['L', 'R', 'M', 'left', 'right', 'middle', 'wheelup', 'WU', 'wheeldown', 'WD', 'wheelleft', 'WL', 'wheelright', 'WR'], str, None]) –

  • click_count (Optional[int]) –

  • direction (Optional[Literal['U', 'D', 'Up', 'Down']]) –

  • relative (Optional[bool]) –

  • blocking (bool) –

  • coord_mode (Optional[Literal['Screen', 'Relative', 'Window', 'Client', '']]) –

  • send_mode (Optional[Literal['Event', 'Input', 'InputThenPlay', 'Play', '']]) –

Return type:

Optional[AsyncFutureResult[None]]

Analog for ImageSearch

Parameters:
  • image_path (str) –

  • upper_bound (Tuple[Union[int, str], Union[int, str]]) –

  • lower_bound (Optional[Tuple[Union[int, str], Union[int, str]]]) –

  • color_variation (Optional[int]) –

  • coord_mode (Optional[Literal['Screen', 'Relative', 'Window', 'Client', '']]) –

  • scale_height (Optional[int]) –

  • scale_width (Optional[int]) –

  • transparent (Optional[str]) –

  • icon (Optional[int]) –

  • blocking (bool) –

Return type:

Union[Coordinates, None, AsyncFutureResult[Optional[Coordinates]]]

async mouse_drag(x, y, *, from_position=None, speed=None, button=None, relative=None, blocking=True, coord_mode=None, send_mode=None)[source]

Analog for MouseClickDrag

Parameters:
  • x (int) –

  • y (int) –

  • from_position (Optional[Tuple[int, int]]) –

  • speed (Optional[int]) –

  • button (Union[int, Literal['L', 'R', 'M', 'left', 'right', 'middle', 'wheelup', 'WU', 'wheeldown', 'WD', 'wheelleft', 'WL', 'wheelright', 'WR'], str, None]) –

  • relative (Optional[bool]) –

  • blocking (bool) –

  • coord_mode (Optional[Literal['Screen', 'Relative', 'Window', 'Client', '']]) –

  • send_mode (Optional[Literal['Event', 'Input', 'InputThenPlay', 'Play', '']]) –

Return type:

Optional[AsyncFutureResult[None]]

async pixel_get_color(x, y, *, coord_mode=None, alt=False, slow=False, rgb=True, blocking=True)[source]

Analog for PixelGetColor

Parameters:
  • x (int) –

  • y (int) –

  • coord_mode (Optional[Literal['Screen', 'Relative', 'Window', 'Client', '']]) –

  • alt (bool) –

  • slow (bool) –

  • rgb (bool) –

  • blocking (bool) –

Return type:

Union[str, AsyncFutureResult[str]]

Analog for PixelSearch

Parameters:
  • search_region_start (Tuple[int, int]) –

  • search_region_end (Tuple[int, int]) –

  • color (Union[str, int]) –

  • variation (int) –

  • coord_mode (Optional[Literal['Screen', 'Relative', 'Window', 'Client', '']]) –

  • fast (bool) –

  • rgb (bool) –

  • blocking (bool) –

Return type:

Union[Coordinates, None, AsyncFutureResult[Optional[Coordinates]]]

async win_close(title='', text='', seconds_to_wait=None, exclude_title='', exclude_text='', *, blocking=True, title_match_mode=None, detect_hidden_windows=None)[source]

Analog for WinClose

Parameters:
  • title (str) –

  • text (str) –

  • seconds_to_wait (Optional[int]) –

  • exclude_title (str) –

  • exclude_text (str) –

  • blocking (bool) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

Return type:

Optional[AsyncFutureResult[None]]

async win_kill(title='', text='', seconds_to_wait=None, exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for WinKill

Parameters:
  • title (str) –

  • text (str) –

  • seconds_to_wait (Optional[int]) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async win_minimize(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for WinMinimize

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async win_maximize(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for WinMaximize

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async win_restore(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for WinRestore

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async win_wait(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, timeout=None, blocking=True)[source]

Analog for WinWait

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • timeout (Optional[int]) –

  • blocking (bool) –

Return type:

Union[AsyncWindow, AsyncFutureResult[AsyncWindow]]

async win_wait_active(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, timeout=None, blocking=True)[source]

Analog for WinWaitActive

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • timeout (Optional[int]) –

  • blocking (bool) –

Return type:

Union[AsyncWindow, AsyncFutureResult[AsyncWindow]]

async win_wait_not_active(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, timeout=None, blocking=True)[source]

Analog for WinWaitNotActive

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • timeout (Optional[int]) –

  • blocking (bool) –

Return type:

Union[AsyncWindow, AsyncFutureResult[AsyncWindow]]

async win_wait_close(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, timeout=None, blocking=True)[source]

Analog for WinWaitClose

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • timeout (Optional[int]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async win_show(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for WinShow

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async win_hide(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for WinHide

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async win_is_active(title='', text='', exclude_title='', exclude_text='', *, title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Check if a window is active.

Uses WinActive

Parameters:
  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Union[bool, AsyncFutureResult[bool]]

async win_move(x, y, *, width=None, height=None, title='', text='', exclude_title='', exclude_text='', title_match_mode=None, detect_hidden_windows=None, blocking=True)[source]

Analog for WinMove

Parameters:
  • x (int) –

  • y (int) –

  • width (Optional[int]) –

  • height (Optional[int]) –

  • title (str) –

  • text (str) –

  • exclude_title (str) –

  • exclude_text (str) –

  • title_match_mode (Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', ''], Tuple[Union[Literal[1, 2, 3, 'RegEx', ''], Literal['Fast', 'Slow', '']], Union[Literal['Fast', 'Slow', ''], Literal[1, 2, 3, 'RegEx', '']]], None]) –

  • detect_hidden_windows (Optional[bool]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async get_clipboard(*, blocking=True)[source]

Get the string contents of the clipboard

Parameters:

blocking (bool) –

Return type:

Union[str, AsyncFutureResult[str]]

async set_clipboard(s, *, blocking=True)[source]

Set the contents of the clipboard

Parameters:
  • s (str) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async get_clipboard_all(*, blocking=True)[source]

Get the full binary contents of the keyboard. The return value is intended to be used with set_clipboard_all()

Parameters:

blocking (bool) –

Return type:

Union[bytes, AsyncFutureResult[bytes]]

async set_clipboard_all(contents, *, blocking=True)[source]

Set the full binary contents of the clipboard. Expects bytes object as returned by get_clipboard_all()

Parameters:
  • contents (bytes) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

on_clipboard_change(callback, ex_handler=None)[source]

call a function in response to clipboard change. Uses OnClipboardChange()

Parameters:
  • callback (Callable[[int], Any]) –

  • ex_handler (Optional[Callable[[int, Exception], Any]]) –

Return type:

None

async clip_wait(timeout=None, wait_for_any_data=False, *, blocking=True)[source]

Wait until the clipboard contents change

Analog for ClipWait

Parameters:
  • timeout (Optional[float]) –

  • wait_for_any_data (bool) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async block_input(value, /)[source]

Analog for BlockInput

Parameters:

value (Literal['On', 'Off', 'Default', 'Send', 'Mouse', 'MouseMove', 'MouseMoveOff', 'SendAndMouse']) –

Return type:

None

async reg_delete(key_name, value_name=None, *, blocking=True)[source]

Analog for RegDelete

Parameters:
  • key_name (str) –

  • value_name (Optional[str]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async reg_write(value_type, key_name, value_name=None, value=None, *, blocking=True)[source]

Analog for RegWrite

Parameters:
  • value_type (Literal['REG_SZ', 'REG_EXPAND_SZ', 'REG_MULTI_SZ', 'REG_DWORD', 'REG_BINARY']) –

  • key_name (str) –

  • value_name (Optional[str]) –

  • value (Optional[str]) –

  • blocking (bool) –

Return type:

Optional[AsyncFutureResult[None]]

async reg_read(key_name, value_name=None, *, blocking=True)[source]

Analog for RegRead

Parameters:
  • key_name (str) –

  • value_name (Optional[str]) –

  • blocking (bool) –

Return type:

Union[str, AsyncFutureResult[str]]

async msg_box(text='', title='Message', buttons=MsgBoxButtons.OK, icon=None, default_button=None, modality=None, help_button=False, text_right_justified=False, right_to_left_reading=False, timeout=None, *, blocking=True)[source]
Parameters:
  • text (str) –

  • title (str) –

  • buttons (MsgBoxButtons) –

  • icon (Optional[MsgBoxIcon]) –

  • default_button (Optional[MsgBoxDefaultButton]) –

  • modality (Optional[MsgBoxModality]) –

  • help_button (bool) –

  • text_right_justified (bool) –

  • right_to_left_reading (bool) –

  • timeout (Optional[int]) –

  • blocking (bool) –

Return type:

Union[str, AsyncFutureResult[str]]

async input_box(prompt='', title='Input', default='', hide=False, width=None, height=None, x=None, y=None, locale=True, timeout=None, *, blocking=True)[source]

Like AHK’s InputBox

If the user presses Cancel or closes the box, None is returned. Otherwise, the user’s input is returned. Raises a TimeoutError if a timeout is specified and expires.

Parameters:
  • prompt (str) –

  • title (str) –

  • default (str) –

  • hide (bool) –

  • width (Optional[int]) –

  • height (Optional[int]) –

  • x (Optional[int]) –

  • y (Optional[int]) –

  • locale (bool) –

  • timeout (Optional[int]) –

  • blocking (bool) –

Return type:

Union[None, str, AsyncFutureResult[str], AsyncFutureResult[None]]

async file_select_box(title='Select File', multi=False, root='', filter='', save_button=False, file_must_exist=False, path_must_exist=False, prompt_create_new_file=False, prompt_override_file=False, follow_shortcuts=True, *, blocking=True)[source]
Parameters:
  • title (str) –

  • multi (bool) –

  • root (str) –

  • filter (str) –

  • save_button (bool) –

  • file_must_exist (bool) –

  • path_must_exist (bool) –

  • prompt_create_new_file (bool) –

  • prompt_override_file (bool) –

  • follow_shortcuts (bool) –

  • blocking (bool) –

Return type:

Union[str, None, AsyncFutureResult[str], AsyncFutureResult[None]]

async folder_select_box(prompt='Select Folder', root='', chroot=False, enable_new_directories=True, edit_field=False, new_dialog_style=False, *, blocking=True)[source]
Parameters:
  • prompt (str) –

  • root (str) –

  • chroot (bool) –

  • enable_new_directories (bool) –

  • edit_field (bool) –

  • new_dialog_style (bool) –

  • blocking (bool) –

Return type:

Union[str, None, AsyncFutureResult[str], AsyncFutureResult[None]]

async block_forever()[source]

Blocks (sleeps) forever. Utility method to prevent script from exiting.

Return type:

NoReturn

async get_version()[source]
Return type:

str

async get_major_version()[source]
Return type:

Literal['v1', 'v2']