I'm quite nervous about doing complicated string concatenations to produce a highly structured format like JSON. I'd be much more interested in having all of the parsing occur in regular Generator code (i.e. not in JSX / through the magic of JSON).

You might consider an approach like in https://github.com/adobe-photoshop/generator-core/blob/master/lib/jsx/getOpenDocumentIDs.jsx

For instance, you could do something like (I haven't executed this code, so it might have bugs):

```javascript
var result = [];
for (var i = 0; i < guides.length; ++i) {
    result.push(guides[i].coordinate + (guides[i].direction === Direction.HORIZONTAL ? "|h" : "|v"));
}

// last statement of JSX, so evaluation of the join call is returned
result.join(":");
```

And then on the Generator side, you'd do something like:

```javascript
// assume 'guideString' is what comes back from JSX
// and that you're in the 'then' handler I complained about above
var guides = { "horizontal" : [], "vertical": [] };
guideString.split(":").forEach(function (guide) {
    var guideParts = guide.split("|"),
        guideFloat,
        guideDirection;
    if (guideParts.length === 2 && (guideParts[1] === "h" || guideParts[1] === "v")) {
        guideFloat = parseFloat(guideParts[0]); // note, parseFloat doesn't have a radix param
        if (isFinite(guideFloat)) {
            guideDirection = (guideParts[1] === "h" ? "horizontal" : "vertical");
            guides[guideDirection].push(guideFloat);
        }
    }
});
```