Post by Joe Glines » 07 Jun 2014, 06:18
Sorry for the delay in posting. Here is an example using AutoHotKey within Python
# Two examples using AutoHotKey from within Python
import win32com.client # Import library / module
dll = win32com.client.Dispatch("AutoHotkey.Script") #Creating DLL object?
dll.ahktextdll() #no idea what this is doing...
dll.ahkExec("Send,My title`n") #uses AutoHotKey to send keystrokes from within Python
dll.ahkExec("Send,second line") #same as above just giving the example twice
#~ Second example- showing a bit more cool things
dll.ahkExec("Send,^a") #Use AutoHotKey to send Control+A (select all)
dll.ahkExec("Send,^c") #use AutoHotKey to copy selected text
dll.ahkExec("Sleep, 1000") #calling sleep in AutoHotKey for 1 second
dll.ahkExec("msgbox %Clipboard%") #using AutoHotKey to show a Msgbox of the clipboard
dll.ahkExec("Click right 144, 155") #using AutoHotKeyto have a right click at specific location
Sorry for the delay in posting. Here is an example using AutoHotKey within Python
[color=#008000]# Two examples using AutoHotKey from within Python[/color]
import win32com.client [color=#008000]# Import library / module[/color]
dll = win32com.client.Dispatch("AutoHotkey.Script") [color=#008000]#Creating DLL object?[/color]
dll.ahktextdll() [color=#008000]#no idea what this is doing...[/color]
dll.ahkExec("Send,My title`n") [color=#008000]#uses AutoHotKey to send keystrokes from within Python[/color]
dll.ahkExec("Send,second line") [color=#008000]#same as above just giving the example twice[/color]
[color=#008000]#~ Second example- showing a bit more cool things[/color]
dll.ahkExec("Send,^a") [color=#008000]#Use AutoHotKey to send Control+A (select all)[/color]
dll.ahkExec("Send,^c") [color=#008000]#use AutoHotKey to copy selected text[/color]
dll.ahkExec("Sleep, 1000") [color=#008000]#calling sleep in AutoHotKey for 1 second[/color]
dll.ahkExec("msgbox %Clipboard%") [color=#008000]#using AutoHotKey to show a Msgbox of the clipboard[/color]
dll.ahkExec("Click right 144, 155") [color=#008000]#using AutoHotKeyto have a right click at specific location[/color]