Using comspec for OBS Websocket

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
LonelyViper
Posts: 1
Joined: 23 Jan 2022, 21:17

Using comspec for OBS Websocket

Post by LonelyViper » 23 Jan 2022, 21:24

Hi all

I've scoured the web to find a solution but I think I lack the understanding to implement it.

I am trying to activate filters with OBS websocket with the below line.

Code: Select all

Run, %comspec% /c V:\Programs\OBSCommand_v1.5.6\OBSCommand\OBSCommand.exe "/server=[IP Address]" "/password=[Password]" "/command=SetSourceFilterVisibility,sourceName="Gaming Rig Mirror",filterName="ZOOMIn",filterEnabled=True"
However, Im unable to rub or compile as I am told that this variable contains an illegal character:

Code: Select all

filterEnabled=True
Does anyone know the correct way to do this?

Thanks!

User avatar
boiler
Posts: 16954
Joined: 21 Dec 2014, 02:44

Re: Using comspec for OBS Websocket

Post by boiler » 24 Jan 2022, 06:28

Try escaping your commas because they are acting as separators between parameters for the Run command:

Code: Select all

Run, %comspec% /c V:\Programs\OBSCommand_v1.5.6\OBSCommand\OBSCommand.exe "/server=[IP Address]" "/password=[Password]" "/command=SetSourceFilterVisibility`,sourceName="Gaming Rig Mirror"`,filterName="ZOOMIn"`,filterEnabled=True"

AHK is interpreting it as you trying to use the part that follows the last comma (filterEnabled=True") as the variable name for the "OutputVarPID" parameter (thus, the illegal character error), with the parts before that being seen as the WorkingDir and Options parameters. When you escape the commas, then the whole thing becomes just the Target parameter.

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Using comspec for OBS Websocket

Post by BoBo » 24 Jan 2022, 07:26

Just out of curiosity I've tried AHK Help's :arrow: continuation section (2nd example) on this ...

Code: Select all

obs := "V:\Programs\OBSCommand_v1.5.6\OBSCommand\OBSCommand.exe"
IPAddress	:="192.168.0.1" 
Password	:="1a2b3c4d5e"

params := "
(Join
  /server=[" . IPAddress . "]
  /password=[" . Password . "]
  /command=SetSourceFilterVisibility
  sourceName=""Gaming Rig Mirror"" 
  filterName=""ZOOMIn""
  filterEnabled=True
)"

ToolTip % params
Sleep 10000
ToolTip

; Run % comspec . "/c " . obs . " " . params,, Hide
ExitApp
So, JFTR :shh:

Post Reply

Return to “Ask for Help (v1)”