Hello,
I am a total noob/unknown to AHK, but after a day or two of googling and asking mates they sent me here. I am looking for a script that hit keyboards in a background application, because i have a macro on my keyboard right now (corsai cue) but then i can't touch my computer since it will use it on whatever window has focus.
I have found this post : https://autohotkey.com/board/topic/7183 ... ackground/
The guy seemed to have the same issue as me, but I personnaly don't undersatnd a word. I also got three applications on the same name and want it to run on two... It would basically just be a loop of very easy keystrokes with delay between each of them that I can provide, but I don't knwo how to get this program id etc...
I know its alot asking but im a total scrub and i really hope you guys can help me out... thank you
Total scrub looking for help, script for background window
Re: Total scrub looking for help, script for background window
You can try this...
WinGet will get the Process ID for you. Replace Notepad with the window title you need the Process ID for. Hope this helps..
Code: Select all
SetTitleMatchMode, 2 ; Match the window title easier
WinGet, winID, PID, Notepad ; PID: Retrieves the Process ID (PID) of a window.
MsgBox, %winID% ; Show the ID of the Notepad window
Loop
{
Send, a ; send keystrokes (letter a)
Sleep, 1000 ; wait 1 second
Send, b
Sleep, 1000
}