April 8, 20223 yr I have a script that builds an object that gets pasted into another application. Over the years this objet has grown in complexity to the point where its a few hundred lines. The problem I have is each time we update the object data I have to break it down line by line in filemaker with forced carriage returns and quotes inorder to preserve the formatting. Eg: { objType { ActionName{ action-item-1: test action-item-2: test2 } } becomes { objType {ActionName{action-item-1: testaction-item-2: test2}}} as soon as the script is run. Formatting seems to be preserved in the script itself but not upon variable assignment. Any ideas how I could get this done? Edited April 8, 20223 yr by NickFaraday
April 8, 20223 yr Could you provide a way (preferably a simple way) to reproduce this problem? I was not able to understand from your description what exactly do you start with and what do you do at the point where the carriage returns are lost. BTW, the text you show looks very much like JSON - but it is not a valid JSON. With valid JSON the carriage returns (which are not essential) can be restored using the JSONFormatElements() function. But that's not an answer to why they are lost in the first place.
April 8, 20223 yr That may just be a Line ending problem. e.g. substitute($text; Char(13); Char(10)) e.g. FileMaker needs Char(13), but other apps may prefer Char(10). And JSON usually escapes returns with \r in the text. Edited April 8, 20223 yr by MonkeybreadSoftware
Create an account or sign in to comment