Skip to main content

Write AutoHotkey scripts in Python

Project description

AutoHotkey.py

Write AutoHotkey scripts in Python.

Description

AutoHotkey.py provides a user-friendly API that lets the user write hotkeys and automation scripts in Python harnessing the power of AutoHotkey. It does so by embedding a Python DLL into the AutoHotkey process.

Quickstart

Ensure that you have installed Python 3.8 or later and AutoHotkey 1.1.28 or later.

Install the package to the Python user install directory. To do that, copy and paste the following into a PowerShell window:

py -m pip install --user autohotkey.py

Write the sample code into the playground.py file:

@"
import sys
import ahkpy as ahk

ahk.message_box("Hello!")

@ahk.hotkey("F1")
def bye():
    ahk.message_box("Bye!")
    sys.exit()
"@ | Out-File -Encoding utf8 playground.py

Finally, run the sample code:

py -m ahkpy playground.py

It will show a "Hello!" message box. When the user presses F1, it will show a "Bye!" message box and exit.

You can check out and run other examples and read the documentation.

Minimum Supported Versions

  • AutoHotkey v1.1.28 (U32 and U64 variants), AutoHotkey v2.0 is not supported #23
  • Python 3.8.0
  • Windows 10, version 1511

Credits

AutoHotkey.py was greatly inspired by Aurelain's Exo. Thanks to Lexikos for his monumental work on AutoHotkey. Thanks to the AutoHotkey site admins for maintaining the lively and welcoming forums.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

AutoHotkey.py-0.2.tar.gz (108.3 kB view hashes)

Uploaded Source

Built Distribution

AutoHotkey.py-0.2-py3-none-any.whl (76.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page