Messages/Max stripping out " marks in http commands for MaxUrl
Hello Gang!
I am trying to send http commands to a ptz camera thru MaxUrl, but when I paste the http command into a message box Max strips out the " marks and re-formats the message. I simply would like to send the original message in it's original format. Patch attached that shows what I'm trying to do.
the original message:
http://192.168.5.102/ajaxcom?szCmd={"SysCtrl":{"PtzCtrl":{"nChanel":0,"szPtzCmd":"left_start", "byValue":50}}}
After I paste it into a message box or use it in Max in any way...
http://192.168.5.102/ajaxcom?szCmd={SysCtrl:{PtzCtrl:{nChanel:0, szPtzCmd:left_start, byValue:50}}}
note that all of the quote " marks are gone, and the camera cannot now recognize the command.
the same command (working) copied from the Firefox Url window reads:
http://192.168.5.102/ajaxcom?szCmd={%22SysCtrl%22:{%22PtzCtrl%22:{%22nChanel%22:0,%22szPtzCmd%22:%22left_start%22,%20%22byValue%22:50}}}
I have tried copying the Firefox url and pasting Max and it also gets reformatted slightly...
Have tried putting my message in a text object and dumping it, but also no success.
Have gotten around this kind of thing before with other ptz camera messages before using Sprintf to build up a http command and using symbols, but have been having no success, as this one uses lots of " marks. (new to me)
Am sure it is something to do with how Max processes message syntax internally.
If anybody has clues to the "why" I'm sure it will be very helpful and illuminating
thanks much
jd
"http://192.168.5.126/ajaxcom?szCmd={\"SysCtrl\":{\"PtzCtrl\":{\"nChanel\":0, \"szPtzCmd\":\"left_start\", \"byValue\":50}}}"
the first problem is that Max removes quotas if Max things they are not needed....
"aaa" ends in aaa if you pass it to max mesage.
\"aaa\" survives it
next problem is comma in a mesage which max uses to break
the line and send comma separated items itered.
So you either enclose the whole thing as a symbol as the top line shows
or also prepend backslash before each comma.
If you need to alter some values in that string on the fly,
sprintf object would be helpfull.
Shame is that help files which used to be much more informative in max 4
got less helpfull in higher max versions, one really has to go through all references
to find so important infos.
If I only think of for example serial object.
about milion times same question has been asked here in the forum,
how to send and receive serial data ... which is for what the damn thing is in first place.
Look in help file - no help at all.
it says "send AT(return) to your modem"
who on earth has a modem today ????
I would hate it to be max beginner nowadays