AutoHotKey to a Batch FIle

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
MrJunky
Posts: 5
Joined: 18 Jul 2015 16:16

AutoHotKey to a Batch FIle

#1 Post by MrJunky » 18 Jul 2015 16:40

I made a AutoHotKey Script but I want to convert it into a windows batch file. This is the AutoHotKey script I made below. The "Run ControlMK" and "Run Oblivion Controller" are shortcut files (.lnk). Mainly all it does is open ControlMK, wait a second, press the down arrow key, wait half a second, open Oblivion Controller, and finally open the Oblivion_Steam.url. When I try to make a Batch file that opens the AutoHotKey script it ignores the Sleep commands since the script is located in my Programs (x86) folder and not my documents. Is there a way to make this run in a batch file?

Run ControlMK
Sleep 1000
Send {Down}
Sleep 500
Run Oblivion Controller
Run Oblivion_Steam.url

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: AutoHotKey to a Batch FIle

#2 Post by Ed Dyreen » 18 Jul 2015 17:03

you want to call these commands from a batch file or convert them to native batch ?, the latter is not possible, they can be converted to vbscript but autohotkey is more suitable. This command:

Code: Select all

Send {Down}
cannot be done in native batch.
MrJunky wrote:When I try to make a Batch file that opens the AutoHotKey script it ignores the Sleep commands since the script is located in my Programs (x86) folder and not my documents.
I do not understand, as I assume it would be unlogical for Sleep, to be a non-native command to autohotkey. I'd write this is autoIT as it's way more versatile than autohotkey. Also you should not send key's into the wild, you should lock on to the receiving window first which can be done with autoIT.

MrJunky
Posts: 5
Joined: 18 Jul 2015 16:16

Re: AutoHotKey to a Batch FIle

#3 Post by MrJunky » 18 Jul 2015 18:17

I figured it out through AutoHotKey! Now it runs without skipping the sleep commands.

Post Reply