Included macros

The following macros are included with the application. More may be added in the future. You can check the Nisus web site periodically for additional macros.

<https://www.nisus.com/pro/macros/>

Application

Manage Macro File Access
Macros can request access to files outside the
sandbox and later restore that access. This macro allows the user to rescind any previously granted file access.

Show All Menu Key Shortcuts
This macro produces a document which lists all keyboard shortcuts (Menu Keys).

Calculation

Average Column This macro evaluates the average of the column of numbers, starting at the current cell and placing the results in the last cell of the column. Note: empty cells are not counted so they do not affect the average, but cells with a zero in them are counted and they do affect the average.
Be sure to have an empty cell in the column otherwise the last cell will be overwritten with the result. Its contents will not be summed.
Place the insertion point in the first cell of the column to be averaged.

Average Row This macro evaluates the average of the row of numbers, starting at the current cell and placing the results in the last cell of the row. Note: empty cells are not counted so they do not affect the average, but cells with a zero in them are counted and they do affect the average.
Be sure to have an empty cell in the row otherwise the last cell will be overwritten with the result and its contents will not be summed.
Place the insertion point in the first cell of the row to be averaged.

Average Rows and Columns
Place the insertion point in the first cell, that is the first row and the first column cell.
Each row and each column of the table will be averaged, with the rows being averaged first. Each average will be placed in the last cell
of each row and column respectively. That means that the last cell, the bottom right corner cell, will contain the average of all row averages.
Those who need the order of averaging reversed can change the order of averaging in this
macro and then the last cell will contain the average of all column averages.
It is, however, important to note that this macro uses two other macros: the
Average Row and the Average Column macros. If you change either of these, you may stop the functioning of this one.

Evaluate Selection Evaluates the selected text based on the operator(s) (+, -, *, /, etc.) in the selection and places the result to the right of and equal sign following the last item in the selection.

Mortgage Calculator Calculates the monthly payment on the specified principal for the given interest rate.

StdDev Column This macro evaluates the standard deviation of the column of numbers, starting at the current cell and placing the results in the last cell of the column. Note: empty cells are not counted so they do not affect the standard deviation, but cells with a zero in them are counted and they do affect the standard deviation.
Be sure to have an empty cell in the column otherwise the last cell will be overwritten with the result. Its contents will not be summed.
Place the insertion point in the first cell of the column to be evaluated.

StdDev Row This macro evaluates the standard deviation of the row of numbers, starting at the current cell and placing the results in the last cell of the row. Note: empty cells are not counted so they do not affect the standard deviation, but cells with a zero in them are counted and they do affect the standard deviation.
Be sure to have an empty cell in the row otherwise the last cell will be overwritten with the result and its contents will not be summed.
Place the insertion point in the first cell of the row to be evaluated.

StdDev Rows and Columns
Place the insertion point in the first cell, that is the first row and the first column cell.
Each row and each column
of the table will be evaluated, with the rows being evaluated first. Each standard deviation will be placed in the last cell of each row and column respectively. That means that the last cell, the bottom right corner cell, will contain the standard deviation of all row standard deviations.
Those who need the order of averaging reversed can change the order of evaluation blocks in this
macro and then the last cell will contain the standard deviation of all column standard deviations.
It is important to note that this macro uses two other macros: the
StdDev Row and the StdDev Column macros. If you change either of those, you may stop the functioning of this one.

Sum Clipboard Sums the numbers copied to the Clipboard by interpreting any white space, including new lines, between numbers as a plus sign.
The result is placed at the insertion point.

Sum Column Sums the column of numbers starting at the current cell and places the result in the last cell of the column.
Be sure to have an empty cell at the bottom
of the column otherwise the last cell will be overwritten with the result and its contents will not be summed.
Place the insertion point in the first cell of the column to be added.

Sum Row Sums the row of numbers starting at the current cell and places the result in the last cell of the row.
Be sure to have a last empty cell in the row otherwise the last cell will be overwritten with the result. Its contents will not be summed.
Place the insertion point in the first cell of the row to be added.

Sum Rows and Columns
Place
the insertion point in the first cell, that is the first row and the first column cell.
Each row and each column of the table will be summed, with the rows being summed first. Each sum will be placed in the last cell of each row and column respectively. That means that the last cell, the bottom right corner cell, will contain the sum of all row sums.
If you need the order
of summing reversed you can change the order of summing in this macro and then the last cell will contain the sum of all column sums.
It is important to note that this macro uses two other macros: the
Sum Row and the Sum Column macros. If you change either of those, you may stop the functioning of this one.

Sum Selection Sums the selected numbers by interpreting any white space, including new lines, between numbers as a plus sign.
The result is placed on a new line at the end
of the selection and bolded.

Clipboards

Clear All Clipboards This clears all Clipboards of their contents.

Restore All Clipboards This reads previously saved Clipboard contents from file(s) created by Save All Clipboards and places the contents onto the Clipboards.

Rotate Clipboards Treats Clipboard 0 through 4 as a circular stack (Clipboard IDs are from 1 through 5) and rotates the contents of each clipboard moving them to the next clipboard in a cyclic way. This means that whatever clipboard you are using, each time you use this macro it will move the contents of Clipboard 1 to Clipboard 0 and Clipboard 0 to Clipboard 4 and so on, without losing any Clipboard data.
The macro
Rotate Clipboards in Reverse moves clipboard contents in the reverse direction.

Rotate Clipboards in Reverse
Treats Clipboard 0 through 4 as a circular stack and rotates the contents of each Clipboard moving them to the next Clipboard in a cyclic way. This means that whatever Clipboard you are using, each time you use this macro it will move the contents of your current Clipboard to the next Clipboard, without losing any Clipboard data. (Contents of Clipboard 0 moved to Clipboard 1, …, Clipboard 4 moved to Clipboard 0.)
The macro
Rotate Clipboards moves Clipboard contents in the forward direction.

Save All Clipboards Saves the current Clipboards in the folder named "SavedClipboards" in the "Clipboards' folder inside the “Macros” folder. In addition this macro must be located within the same "Clipboards" folder.
Use the
Restore All Clipboards macro to put back into the Clipboard the saved data.

Document

Compare Documents Compares the two frontmost documents and produces a new document showing the differences using various formatting cues. By default this macro assumes the topmost document the newer of the two. Styles and attributes of the documents are ignored—the comparison is plain text only.

Compare Duplicate Text Scans the active document for sentences/paragraphs that are duplicates. For a match to occur, the sentence/paragraph must be exactly the same, except for punctuation and whitespace. When finished, a copy of the document will be opened with a list of cross-references to duplicated content.

Compress Files Allows the user to select one or more files to compress as a zip archive, optionally secured by a password. Because the Mac system can now decompress even password protected ZIP archives there is no Decompress Files macro.

Create Email Address List (v2)
Extracts a list of email addresses from the selected text/document.

Create Misspelled Word List
Gathers a list of all misspelled words from the active selection(s). If there is no visible selection, the macro processes the whole document.

Create Phrase Frequency List
Generates a list of all phrases from the selection/document along with their frequency.

Create Word Frequency List (v2)
Extracts a list of all non-common words from the selected text/document and lists their frequency.

Create Word List (v4) Creates a word list in a new document

Join Files Creates a new document by joining all documents in a chosen folder. The macro appends a page break between each file not already ending in a break.

Save All Documents Save all open document windows.

Sort Open Document Windows
This macro sorts all open document windows by file properties, such as
Date Modified - newest first, Date Modified - oldest first, Date Created - newest first, Date Created - oldest first, Name (A-Z), Name (Z-A) and only affects documents saved to disk.’

Editing

Add or Remove Blank Lines
If blank lines appear in the selection this macro removes them. If the selection includes multiple paragraphs with no empty paragraphs between them, this macro adds one return per paragraph.

Cleanup Punctuation This macro is a set of find and replace statements that attempts to clean-up various obvious errors. However, sometimes they may alter what you want. For example if you use multiple question marks (????) or exclamation points (!!!!) or periods (….) to make a point, each such multiple sequence will be replaced by a single character of that sequence. You can comment-out any line which you do not want to operate on your document

Convert Notes to Text This macro takes all footnotes/endnotes in your document and converts them to regular text. The notes will no longer be numbered automatically or appear in a separate editing area. The converted document will be opened as a copy of the existing document.

Font Preview Selected Text
This macro takes the text selected in Nisus Writer Pro and shows you how it would look in a variety of fonts in a new document window. It also enables you to apply that font to the selected text from the new window with one click.

Justify Fully Arabic This macro works on every paragraph in the selection. It manually inserts kashida characters so the last line of each paragraph appears fully justified.

Justify Fully Arabic (remove kashidas)
Removes kashidas from the selection that may have been inserted by running the
Justify Fully Arabic macro.

Justify Fully English Adds spaces to every paragraph in the selection. It manually inserts space characters so the last line of each paragraph appears fully justified.

Justify Fully English (remove spaces)
Removes spaces from the selection that may have been inserted by running the
Justify Fully English macro.

Parenthesize Selection This macro places parentheses “()” around the selection.

Quote Selection This macro places quotes: “” around the selection.

Reverse Text Reverses characters in all selections. Note: does not pay attention to composed character sequences (for example: base char + accent), which is intentional because this is likely to be run on Nisus Writer Classic text. As an example:
.snoitceles lla ni sretcarahc sesreveR

Zap Gremlins This macro deletes all gremlins in the selection/document. See the Glossary (page 705) for a definition of gremlin.

Find

Find All and Show Context
This macro does a
Find All on the frontmost document using find options set in the Find & Replace window and displays the results along with their context creating a concordance.
If the find mode is set to PowerFind or if Attribute Sensitive is checked, the macro uses the find expression in the Find & Replace window.
You can choose a single find result to select it.
You can send all the results to Clipboard.
You can create a new file gathering all sentences containing the found string.
You can bookmark all the results.
The results are preceded by page number and line number. When the latter cannot be retrieved, the kind of text object is reported.

Find in All Open Documents
Uses the current contents and settings of the Find & Replace window and does a
Find All in all open documents.

Find in Indexing Presents two prompts asking first which index to search then what text. If the search field is left blank the macro finds all indexed text. The macro only accepts words and characters, not GREP expressions. The options currently set in the Find and Replace window are used during the search.

Find Next Duplicate Word
Searches the document and selects the next duplicate word (whether separated by a space, tab or Return) and offers the option to replace one or skip. The macro can wrap around to the beginning of the document.

Replace in All Open Documents
Uses the current contents and settings of the Find & Replace window and does a
Replace All in all open documents. Before the replacement is made, the user is warned about the replacement.

Select By Attributes This macro will show you a list of character attributes at the insertion point (or of the first character in the selection).
Check all attributes you need, e.g. “Font Size: 12” and “Italic: On”, and click
Where
Then, you will be asked to specify the find scope. Check all text areas to be included, for example: “body” and “footnote”, and click
Select All….
All text portions meeting the criteria, i.e. “Font Size: 12” and “Italic: On” in “body” and “footnote”, will be selected.

Select By Font This macro will prompt a list of all used fonts, with which you can select all text portions in a given font(s).

Select By Language This macro will show you a list of all languages used in the document, from which you can choose whose corresponding text should be selected.

Select By Style This macro lists up all Character/Paragraph/List styles used in the frontmost document and enables you to select all text portions in style(s) of your choice.

Templates

Find All Inserts an example macro command that finds all matching text in the document.

Find All in Selection Inserts an example macro command that finds all matching text within the active document's selection.

Find Loop Inserts an example macro that loops through all matching text in a document, so you can customize how the matches are processed.

Perl Block Inserts a macro header that can be used at the top of a Perl macro or block. Note: Perl macros are generally more limited than Nisus Writer macros. If you want to use Perl it's often easier to use an embedded Perl block via a Begin Perl block (see the macro reference for details).

Process Open Documents
Inserts an example macro that loops through all open documents, so you can customize how the documents are processed.

Process Text Selections Inserts an example macro that loops through all text selections in the frontmost document, so you can customize how the text is processed.

Replace All Inserts an example macro command that replaces all matching text in a document.

Replace All in Selection Inserts an example macro command that replaces all matching text within the active document's selection.


Previous Chapter
Work with Menu Commands
<<  index  >>
 
Next Chapter
Macros, the Deeper Workings