Hello Adepters,
I've written an ACL script to accept all changes in a document, using change_tracking_accept_change(). It works, but the problem is that for some changes, it pops up a message box that says: "Accepting this change will remove nested changes. Continue with the accept?"
As far as I can tell, using my script (clicking 'yes' to all the above messages) and using the built-in functionality in Tools > Change Tracking > Accept or Reject Changes produces an identical document.
So I have two questions: (1) Is there a better, built-in way to programatically accept all tracked changes in a document? and (2) Is there a way to suppress the message boxes in my ACL script?
Here's the script:
function accept_all_changes()
{
#array of change-tracking tags
local tags[9]
tags[1] = "atict:add"
tags[2] = "atict:del"
tags[3] = "atict:addm"
tags[4] = "atict:delm"
tags[5] = "atict:chgm"
tags[6] = "atict:join1"
tags[7] = "atict:join2"
tags[8] = "atict:split1"
tags[9] = "atict:aplit2"
$document = oid_root()
#loop through each change-tracking tag
for ($i=1; $i <= 9; $i++) {
$num = oid_find_children($document, $arr, $tags[$i])
for ($j=1; $j <= $num; $j++) {
change_tracking_accept_change($arr[$j])
}
}
}
Thanks,
-James