Code: Select all
this.addAnnot( { type:"FreeText", contents:"You can't undo me!", page:0} );
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Code: Select all
this.addAnnot( { type:"FreeText", contents:"You can't undo me!", page:0} );
Code: Select all
beginUndo();
// add an annotation
endUndo()
No, the document we be marked as modified anyways.Mathew wrote: ↑Wed May 31, 2023 1:53 am I think excluding script actions from the undo list is very counterintuitive. If I run a script that makes changes on a document, if the undo ignores it, I won't be able to save the changes (PDF-XChange will act like nothing has changed). I have to make a manual change before it even un-greys the save button.
It adds an undo item for every other change javascript does to annotations. I agree that it's not great to be adding many, many undos, but at least until a better way (such as grouping undos within scripts), can this be changed to be consistent? It currently makes for some really strange situations when javascript moves annotations, or makes changes, and also adds annotations. The added annotations stay put and cannot be undone, but everything else can be undone, including deleting that annotation. Run this script and then undo:
Code: Select all
this.addAnnot( { type:"FreeText", contents:"You can't undo me!", page:this.pageNum} ).destroy();