nisus.com
https://www.nisus.com/forum/

Need a macro for track change
https://www.nisus.com/forum/viewtopic.php?f=17&t=5749
Page 1 of 1

Author:  Nobumi Iyanaga [ 2014-06-13 06:37:13 ]
Post subject:  Need a macro for track change

Hello,

I would like to have a macro that will "accept" all the track changes that are "isTextAttributesChanged". Here is the situation in which such a macro is needed. I have a long document in several versions. I can use MS Word to compare two of them, and generate a file in which all the differences are recorded as "history" or "track changes". I save the file as an rtf file, and open it in NWP, and I can see the differences in the track change panel. However, what I really need is only the text content changes, while there are too many "isTextAttributesChanged" only changes.

If I can "accept" all these "isTextAttributesChanged", I will only have the text content changes, so that it will be much easier to concentrate on them.

I think it is possible to write such a macro, but I don't know how...

Are there any kind souls who can help me to write such a macro (which, I guess, can be useful for other people too...).

Thank you very much in advance.

Best regard,

ni

Author:  phspaelti [ 2014-06-13 07:27:25 ]
Post subject:  Re: Need a macro for track change

Hi Nobumi,

from the way you describe the issue, the following should do the trick:

Code:
$doc = Document.active
foreach $change in  $doc.allTrackedChanges
    if $change.isTextAttributesChanged
        $change.accept
    end
end


I haven't tried this at all, so of course the usual disclaimers apply. (Try it on a back-up copy, etc.)

Attachments:
Accept_Formatting_Changes_Only.nwm [16.33 KiB]
Downloaded 161 times

Author:  Nobumi Iyanaga [ 2014-06-13 17:36:13 ]
Post subject:  Re: Need a macro for track change

Hello Philip,

Thank you for your prompt reply.

I tested your macro. It worked perfectly. I saved it as the macro "Track_change-keep-contents" : its speed is very surprising.

Thank you again for your kind help!

Nobumi

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/