Need a macro for track change

Get help using and writing Nisus Writer Pro macros.
Post Reply
Nobumi Iyanaga
Posts: 151
Joined: 2007-01-17 05:46:17
Location: Tokyo, Japan
Contact:

Need a macro for track change

Post by Nobumi Iyanaga » 2014-06-13 06:37:13

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
Best regards,

Nobumi Iyanaga
Tokyo,
Japan

User avatar
phspaelti
Posts: 918
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Need a macro for track change

Post by phspaelti » 2014-06-13 07:27:25

Hi Nobumi,

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

Code: Select all

$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 173 times
philip

Nobumi Iyanaga
Posts: 151
Joined: 2007-01-17 05:46:17
Location: Tokyo, Japan
Contact:

Re: Need a macro for track change

Post by Nobumi Iyanaga » 2014-06-13 17:36:13

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
Best regards,

Nobumi Iyanaga
Tokyo,
Japan

Post Reply