Sending line break to flash from LiveCode

Found my problem. Still no clue why it happens but if i send PLAY for 2 different layers then send my CG ADD i get the problem listed below
If i send the CG ADD first then the two PLAYs then it works ok

I’ve had to update from 2.0.7 to 2.1 beta 2 due to transcoding problems i was having that 2.1 solved.
Here is my problem. Ive got a field in livecode that i can put some info into and have my fl template pull it up on screen with no problem in 2.0.7. When i get to 2.1 though something weird happens. Here is the code from Livecode.

put the text of fld “Mytext” into thistext
replace quote with “’” in thistext
put empty into deQuest
put “CG 1-45 ADD 1 “&quote&“info”&quote&” 1 " into deQuest
put quote &”" after deQuest
put “<componentData id=”& quote &“F0”& quote &"><data id="& quote &“text”& quote &" value="& quote & thisname &""& quote &"/>" after deQuest
put “”& quote after deQuest
write deQuest & format("\r\n") to socket gConnectionAddy

in casparcg 2.0.7 this is what i get. I can also use the CG update fine in 2.0.7

[2018-08-11 12:52:33.756] [8160] [info] Received message from 127.0.0.1: CG 1-45 ADD 1 “info” 1 “<componentData id=“F0”><data id=“text” value=“First line
Second Line”/>”\r\n

When i use the same code to send to 2.1 this is what happens

[2018-08-11 13:02:36.335] [6620] [info] Received message from 127.0.0.1: CG 1-45 ADD 1 “info” 1 “<componentData id=“F0”><data id=“text” value=“First Line\r\n
[2018-08-11 13:02:36.335] [6620] [info] Received message from 127.0.0.1: econd Line”/>”\r\n
[2018-08-11 13:02:36.335] [6620] [info] Sent message to 127.0.0.1:400 ERROR\r\necond Line"/>"\r\n

but when i send 1 line to bring up the CG then add a second line and use update it works fine. Also when i use casparcg client and send something with 2 lines it sends fine. What am i doing wrong?

I don’t know the answer to your problem, but I also had similar problems with Livecode to CasparCG. I wrote about it here .

There may or may not be clues there

B

You need to send \n as a replacement for the linebreak, otherways Caspar interpretes the linebreak as end of the command. That’s the reason for the message

It thinks this is a new command and falis to figure out what it is. The XML is also not complete, as you open the tag without closing it and alo do not wrap the whole thing into an enclosing tag. A fully escaped templateData XML should lock like this:

<templateData>
	<componentData id=\"f0\">
		<data id=\"text\" value=\"First\"/>
	</componentData>
	<componentData id=\"f1\">
		<data id=\"text\" value=\"Second\"/>
	</componentData>
</templateData>

As you can see, the " are escaped as \" also.

Actually there as nothing wrong with my structure or anything. It seemed to be a livecode problem. I was writing to socket twice to bring up two images then another time to bring up the flash template. When i reordered my writes so that it wrote to socket the flash first then the two layers it worked again.