Compare Documents macro: Perl syntax error

Get help using and writing Nisus Writer Pro macros.
Post Reply
Bob Stern
Posts: 167
Joined: 2006-03-12 12:32:47

Compare Documents macro: Perl syntax error

Post by Bob Stern »

The Compare Documents macro at:
https://nisus.com/pro/macros/browse.php ... y=Document

no longer runs because of a syntax error arising from changes in Perl.

The fix is to insert a backslash before the left brace { in this line of the macro:
$diffRTF =~ s/(?x)({\\colortbl;\\red255\\green255\\blue255;)

Details of possible interest to Martin:
The error message when running the macro is:
"Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32), passed through in regex"
My version of Perl is v5.30.3, so it should not be a fatal error, but perhaps NWP's macro engine cannot tolerate Perl messages to stderr.
User avatar
martin
Official Nisus Person
Posts: 5096
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Compare Documents macro: Perl syntax error

Post by martin »

Thanks for the heads up Bob! This error/change should already be fixed in the macros distributed inside the app itself, but I need to fix the file in the online repository. I hope this snag didn't give you too much trouble.
Bob Stern
Posts: 167
Joined: 2006-03-12 12:32:47

Re: Compare Documents macro: Perl syntax error

Post by Bob Stern »

Thanks, Martin. It was my fault. A long time ago I renamed the original macro and moved it into the top level Macros folder, so I never discovered that you had updated and improved the original macro.

It seems that when the Macros menu is populated, aliases and symlinks are ignored. Would that be an easy feature to add? (Famous last words, right?)
User avatar
martin
Official Nisus Person
Posts: 5096
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Compare Documents macro: Perl syntax error

Post by martin »

Bob Stern wrote: 2022-07-20 11:48:40 It seems that when the Macros menu is populated, aliases and symlinks are ignored. Would that be an easy feature to add? (Famous last words, right?)
This used to be possible, but the problem now is sandboxing. There's no way for Nisus Writer to automatically gain access when following such redirections to other folders. The macOS system won't allow it.

However, Nisus Writer does have a feature intended to help remedy this situation: the menu Macro > Add Subfolder to Menu as Alias which does the necessary rigamarole to capture sandboxing permissions. I hope that helps!
Bob Stern
Posts: 167
Joined: 2006-03-12 12:32:47

Re: Compare Documents macro: Perl syntax error

Post by Bob Stern »

Thanks, Martin, but that does the opposite of what I wanted, which was to make my favorite macros appear in the top level of the Macros menu instead of a sub-menu.
Post Reply