How to get the xml of a sprite using JS

You actually can get the xml of a script, if it has been edited (which includes moving it or editing an input, e.g. enter an input and hit enter)...

untitled script pic

Unfortunately the user has to edit or drag and drop a script (and you can say the script, then drag and drop the script in the speech bubble back onto the speech bubble, and it'll work).


And to answer your actual question, I did a bit of searching the console, and found out that you can literally just do this

sprite.toXMLString()

And sprite is a SpriteMorph aka, what you get from the (object ) reporter.