@Nate-Hales
SimKeys.ahk
; By SKAN, http://goo.gl/JfMNpN, CD:23/Aug/2014 | MD:24/Aug/2014
#Warn
#SingleInstance, Force
Args( CmdLine := "", Skip := 0 ) {
Local pArgs := 0, nArgs := 0, A := []
pArgs := DllCall( "Shell32\CommandLineToArgvW", "WStr",CmdLine, "PtrP",nArgs, "Ptr" )
Loop % ( nArgs )
If ( A_Index > Skip )
A[ A_Index - Skip ] := StrGet( NumGet( ( A_Index - 1 ) * A_PtrSize + pArgs ), "UTF-16" )
Return A, A[0] := nArgs - Skip, DllCall( "LocalFree", "Ptr", pArgs)
}
CmdLine := DllCall( "GetCommandLine", "Str" )
Skip := ( A_IsCompiled ? 1 : 2 )
argv := Args( CmdLine, Skip )
If ( argv[0] == 1 )
Send % argv[1]
Else
Msgbox, , Error, Must provide exactly one argument, 10
;Msgbox % "Count = " argv[0] "`n1=" argv[1] "`n2=" argv[2] "`n3=" argv[3] "`n4=" argv[4] "`n5=" argv[5]
SimKeys.vbs
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys WScript.Arguments(0)
Excerpt from commands.json
{"trigger":"Play", "command":"\"C:\\Program Files\\AutoHotkey\\AutoHotkeyU64\" C: YOUR DIRECTORY \\SimKeys.ahk {Media_Play_Pause}", "ground":"foreground", "voice":"play"},
{"trigger":"Pause", "command":"\"C:\\Program Files\\AutoHotkey\\AutoHotkeyU64\" C: YOUR DIRECTORY \\SimKeys.ahk {Media_Play_Pause}", "ground":"foreground", "voice":"pause"},
{"trigger":"Stop", "command":"\"C:\\Program Files\\AutoHotkey\\AutoHotkeyU64\" C: YOUR DIRECTORY \\SimKeys.ahk {Media_Stop}", "ground":"foreground", "voice":"stop"},
{"trigger":"Previous", "command":"\"C:\\Program Files\\AutoHotkey\\AutoHotkeyU64\" C: YOUR DIRECTORY \\SimKeys.ahk {Media_Prev}", "ground":"foreground", "voice":"previous"},
{"trigger":"Next", "command":"\"C:\\Program Files\\AutoHotkey\\AutoHotkeyU64\" C: YOUR DIRECTORY \\SimKeys.ahk {Media_Next}", "ground":"foreground", "voice":"next"},
{"trigger":"Volume Up", "command":"\"C:\\Program Files\\AutoHotkey\\AutoHotkeyU64\" C: YOUR DIRECTORY \\SimKeys.ahk {Volume_Up}", "ground":"foreground", "voice":"volume up"},
{"trigger":"Volume Down", "command":"\"C:\\Program Files\\AutoHotkey\\AutoHotkeyU64\" C: YOUR DIRECTORY \\SimKeys.ahk {Volume_Down}", "ground":"foreground", "voice":"volume down"},
{"trigger":"Mute/Unmute", "command":"\"C:\\Program Files\\AutoHotkey\\AutoHotkeyU64\" C: YOUR DIRECTORY \\SimKeys.ahk {Volume_Mute}", "ground":"foreground", "voice":"mute"},
Replace "YOUR DIRECTORY" with the proper path to SimKeys.ahk and SimKeys.vbs (both need to be in the same location).
Edit: It appears SimKeys.vbs is not necessary. I don't remember why I have it--possibly because I was trying out an alternate method and forgot to move/remove it. I'm leaving it here just in case.