you can use
ControlSend to specify the target process/window of a key press.
Your requested script my look something like this (untested)
Note: I'm running the 64 bit version of OBS, so for me, the process name is obs64.exe, but you can verify this using the Window Spy (
https://amourspirit.github.io/AutoHotkey-Snippit/WindowSpy.html) tool.
Code: Select all
obs_exe := ahk_exe obs64.exe
^l:: ;trigger on ctrl l
ControlSend, , 0, %obs_exe% ; send a zero to OBS
Sleep, 1000 ; delay 1 second
ControlSend, , ^t, %obs_exe% ; send CTRL + t to obs - note, use file->settings->Hotkeys->TEST->Switch to scene to set this to switch OBS to the desired scene
;; TODO: send !test to chat window - I don't have a chat plugin installed, but if it's a seperate window, you can use Window Spy to find the ahk process and/or class name to provide to CTRL send - if it's in the same window, use Window Spy to find the desired control - or lookup what keyboard shortcuts exist that you can have AHK hit then type the message.
return ; block the original keystroke