I'm trying to write a simple robot which substitutes card images for card names inside a Wave. There are plenty of examples of people doing something like this, which should make it easy.
However, when I call Document.InsertElement to place an image inside some newly-created text, it works fine for the first image. But the second image is two characters too early, and the next is four characters too early. So I guess the answer is just to insert a 'fudge factor' of 2 characters, but I don't know why.
The best suggestion I've seen so far is to insert the images in reverse order. And there's a bug open which suggests I may run into more problems when I try actually editing text rather than copying it.
Nothing like playing around with somebody else's alpha-quality software to make my work problems seem downright tractable. ;)
Also, debugging Wave robots highlights a weakness of request/response RPC (particularly HTTP-based RPC): there is no way for the client/sender to tell the server that its response was garbage.