Thanks for helping out Suslik.When OBS called from batch file or command line - the first thing you need to do is to change current directory:
CD path_to_the_folder_where_obs_exe_lies
Launch_App1:: ;show/minimize OBS64
IfWinNotExist, OBS64.exe
{
Run, C:\Program Files\obs-studio\bin\64bit\obs64.exe
Sleep, 200
return
}
else
{
WinGet,CurrentState,MinMax, OBS64.exe
if (CurrentState = -1) ; The window is minimized
WinRestore, OBS64.exe
else
WinMinimize, OBS64.exe
}
return
obs64.exe
, then your working directory is somewhere else. *That's* what you need to fix.Launch_App1:: ;show/minimize OBS64
If Not WinExist (“OBS 30.0.2 - Profile”)
{
Run, c:\ProgramData\Microsoft\Windows\Start Menu\Programs\OBS Studio\OBS Studio (64bit).lnk
return
}
else
{
WinGet,CurrentState,MinMax, OBS 30.0.2 - Profile
if (CurrentState = -1) ; The window is minimized
WinRestore, OBS 30.0.2 - Profile: Fresh - Scenes: Test
else
WinMinimize, OBS 30.0.2 - Profile: Fresh - Scenes: Test
}
Return
Launch_App1:: ;show/minimize OBS64
IfWinNotExist, OBS 30.0.2 - Profile
{
Run, c:\ProgramData\Microsoft\Windows\Start Menu\Programs\OBS Studio\OBS Studio (64bit).lnk
return
}
else
{
WinGet,CurrentState,MinMax, OBS 30.0.2 - Profile
if (CurrentState = -1) ; The window is minimized
WinRestore, OBS 30.0.2 - Profile: Fresh - Scenes: Test
else
WinMinimize, OBS 30.0.2 - Profile: Fresh - Scenes: Test
}
Return