On the Mac, in a ScriptUI editbox, I can type Control-Return or Control-M and insert a line break into my text. This, AFAICT, I interpreted as Unicode U+2028 by InDesign.
If I go to the Story Editor for XML and hit the Return key inside an element, InDesign will produce a Unicode U+2029, I believe.
Is there a way of entering U+2029 into my editbox on either Mac or Windows?
OK, some more detail, on the Mac only, haven't tried any of this on Windows:
In a ScriptUI editext box, you can type ^M (or maybe identically Option-return) to place a paragraph separator into the text of the box. The character code inserted is 0x0a or \n. It seems that you can type ^P into an edittext box and get carriage return behavior, but it's not preserved in the text string as 0x0d or \r. (IIRC, it's not preserved at all.)
When ^M is written into the text of XML story element, the \n is written as a "forced line break" (or in Applescript, an 'SFlb' type). When the XML is exported, it's represented as U+2028, but if I was to examine it's value via ExtendScript using something like this:
I'd get the unpleasant error:
118:183: execution error: Adobe InDesign CS5 got an error: app.activeDocument.xmlElements.xmlElements.xmlElements.characters.contents.charCodeAt is not a function (24)
ExtendScript is happy to represent what gets exported in XML as U+2029 as '\r' (this would be what is inserted with the Return key in the Story Editor), and the above sample code will work without problem.
To conclude: I have my work-around, which is to convert \n in a ScriptUI edittext box to \r before writing the text to an XML element. (Providing this behavior works on Windows as well.) I'm still mystified by the ExtendScript error, and if anyone has a comment, I appreciate hearing it.