async def from_pid(cls, engine: ScriptEngine, pid, **kwargs): script = engine.render_template('window/get.ahk', subcommand="ID", title=f'ahk_pid {pid}') ahk_id = await engine.a_run_script(script) return cls(engine=engine, ahk_id=ahk_id, **kwargs)
async def from_mouse_position(cls, engine: ScriptEngine, **kwargs): script = engine.render_template('window/from_mouse.ahk') ahk_id = await engine.a_run_script(script) return cls(engine=engine, ahk_id=ahk_id, **kwargs)