Home Forums General XMetaL Discussion Issue with Accept/Reject Change Tracking Programmatically Reply To: Issue with Accept/Reject Change Tracking Programmatically

Derek Read

Reply to: Issue with Accept/Reject Change Tracking Programmatically

I can't reproduce this issue in either 8.0.1.051 (your version) or 9.0.0.047 (current release), presumably because my test is not the same as your's because I don't have all your code.

I'm not sure how you are setting up or checking the value for supplCount.length in your while loop, so instead of doing that I'm repeatedly running the code within it, manually, over and over.

I've created the following test document based on your snippet that includes change tracking that matches your indexOf() match as well as exact copies of your snippet that do not match. The ones that match are rejected (restored to the document), the ones that don't match are left alone. No crash. Perhaps try my test to see if you can reproduce. If not then the issue is probably triggered by the code I don't have.

[code=test DITA topic]




 <?xm-replace_text Topic Title?>
 
 

[/code]

[code=test code]
//XMetaL Script Language JScript:
ActiveDocument.GotoNextChange();
var strChange = Selection.TextWithRM;
//ActiveDocument.Host.Alert(strChange);
if (strChange.indexOf(“author=”No Change””) > 0 && ActiveDocument.CanAcceptOrRejectChange()) {
   ActiveDocument.RejectChange();
}
[/code]

Reply

Products
Downloads
Support