Code: Select all
#SingleInstance, force
!^+Y::
ControlSend, ahk_parent, !^+z, OBS
Sleep, 2000
MsgBox, % "Done"
ControlSend, ahk_parent, !^+z, OBS
MsgBox, % "Done2"
Return
Any help with this issue would be greatly appreciated!
Code: Select all
#SingleInstance, force
!^+Y::
ControlSend, ahk_parent, !^+z, OBS
Sleep, 2000
MsgBox, % "Done"
ControlSend, ahk_parent, !^+z, OBS
MsgBox, % "Done2"
Return
Code: Select all
#SingleInstance, force
!^+Y::
ControlSend, ahk_parent, !^+z, OBS
if ErrorLevel
MsgBox % "Error with ControlSend"
Sleep, 2000
MsgBox, % "Done"
ControlSend, ahk_parent, !^+z, OBS
MsgBox, % "Done2"
Return
Code: Select all
#SingleInstance, force
!^+Y::
ControlSend, ahk_parent, !^+z, OBS 24.0.1 (64-bit, windows) - Profile: sound record - Scenes: sound record (blank)
if ErrorLevel
MsgBox % "Error with ControlSend"
Sleep, 2000
MsgBox, % "Done"
ControlSend, ahk_parent, !^+z, OBS 24.0.1 (64-bit, windows) - Profile: sound record - Scenes: sound record (blank)
MsgBox, % "Done2"
Return
Code: Select all
ControlSend, ahk_parent, !^+z, % "OBS 24.0.1 (64-bit, windows) - Profile: sound record - Scenes: sound record (blank)"
Code: Select all
ControlSend, ahk_parent, !^+z, OBS 24 ahk_class whateverthisOBSclassiscalled
https://www.autohotkey.com/docs/misc/WinTitle.htm#multi wrote:Multiple Criteria
[...]
When using this method, the text of the title (if any is desired) should be listed first, followed by one or more additional criteria. Criteria beyond the first should be separated from the previous with exactly one space or tab (any other spaces or tabs are treated as a literal part of the previous criterion).
Code: Select all
UniqueID := WinExist("OBS 24")
ControlSend, ahk_parent, !^+z, ahk_id %UniqueID%
if ErrorLevel
MsgBox % "Error with ControlSend"
Sleep, 2000
ControlSend, ahk_parent, !^+z, ahk_id %UniqueID%
Code: Select all
#SingleInstance, force
!^+Y::
start()
pause()
stop()
Return
start()
{
ControlSend, ahk_parent, !^+z, OBS
MsgBox, % "Started"
}
pause()
{
Sleep, 2000
MsgBox, % "Paused"
}
stop()
{
ControlSend, ahk_parent, !^+x, OBS
MsgBox, % "Stopped"
}
Code: Select all
!^+Y::
start()
if ErrorLevel
MsgBox % "Error with ControlSend"
start()
if ErrorLevel
MsgBox % "Error with ControlSend"
start()
if ErrorLevel
MsgBox % "Error with ControlSend"
start()
if ErrorLevel
MsgBox % "Error with ControlSend"
start()
if ErrorLevel
MsgBox % "Error with ControlSend"
stop()
if ErrorLevel
MsgBox % "Error with ControlSend"
Return
For testing, I wouldn't use the process id pid which might have different windows, afaik, but the specific ahk_id for one specific, hopefully the right, window.I tried both of those options - using the ahk_class, using the class and name, using the pid, and I tried with the % and quotes.
Code: Select all
ControlSend, ahk_parent, !^+x, OBS
Code: Select all
#SingleInstance, force
!^+Y::
Send !^+Z
Sleep, 2000
Send !^+Z
Return
Code: Select all
#SingleInstance, force
abc:=0
!^+Y::
MsgBox % "control recieved"
SetTimer, startRecording, 5000
Return
startRecording:
MsgBox % "startRecording activated"
if (abc < 2){
MsgBox % "Before controlsend"
ControlSend, ahk_parent, !^+z, OBS
MsgBox % "after controlsend"
abc++
}
else{
ExitApp
}
Return
Code: Select all
#SingleInstance, force
abc:=0
!^+Y::
MsgBox % "control recieved"
SetTimer, startRecording, 5000
Return
startRecording:
MsgBox % "startRecording activated"
if (abc < 2){
MsgBox % "Before controlsend"
Send !^+Z
MsgBox % "after controlsend"
abc++
}
else{
ExitApp
}
Return
Code: Select all
#SingleInstance, force
!^+Y::
ControlSend, ahk_parent, !^+z, OBS
Return
Code: Select all
#SingleInstance, force
!^+Y::
ControlClick, Qt5QWindowIcon1, OBS,,,, NA x66 y59
Sleep, 2000
ControlClick, Qt5QWindowIcon1, OBS,,,, NA x66 y59
Return