Skip to content

Commit c7c20bc

Browse files
committed
add run_script examples
1 parent 23139b7 commit c7c20bc

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

docs/README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,25 @@ code is safe.
442442

443443
## Run arbitrary AutoHotkey scripts
444444

445-
TBD
445+
You can also run arbitrary AutoHotkey code either as a `.ahk` script file or as a string containing AHK code.
446446

447+
```python
448+
from ahk import AHK
449+
ahk = AHK()
450+
my_script = '''\
451+
MouseMove, 100, 100
452+
; etc...
453+
'''
454+
455+
ahk.run_script(my_script)
456+
```
457+
458+
```python
459+
from ahk import AHK
460+
ahk = AHK()
461+
script_path = r'C:\Path\To\myscript.ahk'
462+
ahk.run_script(script_path)
463+
```
447464

448465

449466
<a name="deps" />

0 commit comments

Comments
 (0)