"you could revert the document to the original version after export or not save the document and save a copy of the current document."
This is not possible, because after the tagging process of a page, we will to run a third-party plugin which will grab the XML and PDF from the page at the same time automatically for other applications.
Hi eboda_snaf,
It's not clear from your messages that this is a scripting question, but I'll answer as if it is.
Take a look at the Scripting Guide script MarkingUpGraphics.jsx. We can demonstrate your problem by making a few changes to the script. Find the line (in the mySnippet function):
var myGraphic = myDocument.pages.item(0).pageItems.item(0).graphics.item(0);
Now add this line following the line above:
myGraphic.parent.locked = true;
Run the script, and you'll see the error message stating that InDesign cannot tag the graphic because it's locked.
Now add the following lines below the line we just added:
var myRestoreLock = false;
if(myGraphic.parent.locked == true){
myGraphic.parent.locked = false;
myRestoreLock = true;
}
Next, find the line:
var myXMLElement = myDocument.xmlElements.item(0).xmlElements.add(myXMLTag, myGraphic);
...and add the following lines below it:
if(myRestoreLock == true){
myGraphic.parent.locked = true;
}
Now run the script again. You'll see that the script unlocks the graphic (or its parent rectangle, really). The script will not change the location of the graphic.
Thanks,
Ole