Search found 20 matches

by capvideo
2018-02-01 09:56:06
Forum: Nisus Writer Pro Macros
Topic: Inline Markdown footnotes
Replies: 3
Views: 940

Re: Inline Markdown footnotes

Push Target sounds interesting. However, it doesn’t look like it allows the use of menu commands on Pushed objects. NOTE: normal menu based commands like “Bold” still affect the active document as normal. I did try it anyway: Macro.run "Markdown Preview" $document = Document.active #Convert Footnote...
by capvideo
2018-01-31 15:14:29
Forum: Nisus Writer Pro Macros
Topic: Inline Markdown footnotes
Replies: 3
Views: 940

Inline Markdown footnotes

I use Martin’s simple Markdown script to convert Markdown to a Nisus document; I recently ran into the need to also convert inline footnotes, and added the following code: Macro.run "Markdown Preview" $document = Document.active #Convert Inline Footnotes While Find Next '\[\^[^\]]+\]', "E" $noteText...
by capvideo
2016-03-10 06:56:00
Forum: Nisus Writer Pro Macros
Topic: Macro: convert superscript digits to plain digits, endnotes.
Replies: 5
Views: 2019

Re: Macro: convert superscript digits to plain digits, endno

Depending on your needs, Nisus might do this for you already. When you copy text, Nisus stores multiple versions on the clipboard; if you paste it into a text editor, it will use the text-only version. For example, here are the results of a single sentence with two footnotes, copied from Nisus and p...
by capvideo
2016-03-09 06:57:37
Forum: Nisus Writer Pro
Topic: How to convert Perl script macros for opening documents
Replies: 5
Views: 1458

Re: How to convert Perl script macros for opening documents

How can I convert my old Perl Script macros for opening documents so that they work in NWP 2.1? Here's the one I used most frequently, but I have several others I'd also like to make work again. #!/usr/bin/perl `open -a "Nisus Writer Pro" '~/Documents/MIKE/JOURNALS/2010s/2016/02.16.rtf` # end of sc...
by capvideo
2015-04-05 20:23:12
Forum: Nisus Writer Pro Macros
Topic: paragraph style as a condition
Replies: 2
Views: 2531

Re: paragraph style as a condition

Judging from my own code, what you want is $parStyle.name. TextSelection.paragraphStyle returns a style object; the property “name” on that object contains the style’s name as text. Getting the style’s name as text allows you to compare the style name to some text of your own. $parName = $parStyle.n...
by capvideo
2015-01-07 10:27:00
Forum: Nisus Writer Pro
Topic: Search for Font Size then replace with Style
Replies: 3
Views: 1490

Re: Search for Font Size then replace with Style

You should be able to replace with "Found" text (under the "Match" menu under the gear icon next to "Replace with:" (quoted text from the English version). Set the style of the "Found" bullet to what you want the matched text to be styled, and it should work. I've done this sort of thing many times,...
by capvideo
2014-09-03 12:47:21
Forum: Nisus Writer Pro Macros
Topic: Macro for counting frequency of Words used in a document
Replies: 4
Views: 3682

Re: Macro for counting frequency of Words used in a docum

(b) A quick search on AppleScript in the Nisus Macro Reference (available from the Help menu in Nisus Pro) shows the “Run AppleScript” command. I don’t recall ever using it, but it appears to be possible. (a) The Learning Perl book from O’Reilly was quite useful when I used it; I haven’t looked at t...
by capvideo
2014-09-02 20:24:02
Forum: Nisus Writer Pro Macros
Topic: Macro for counting frequency of Words used in a document
Replies: 4
Views: 3682

Re: Macro for counting frequency of Words used in a docum

This is the kind of thing Perl is pretty good at. # Get the current document $document = Document.active # Get all the text (but not headers or tables) $text = $document.text # Count them $words = '' Begin Perl #sort subroutine to sort by frequency in descending order sub byFrequency { $words{$b} <=...
by capvideo
2014-08-21 12:20:56
Forum: Nisus Writer Pro Macros
Topic: Macro for Exporting or Save as Plain Text
Replies: 9
Views: 5161

Re: Macro for Exporting or Save as Plain Text

Depends on what it is you want. If you want the text to be readable as a text document, you'll probably need to go through and modify things as you save it. I have a macro I use to export short stories/novels to text format. It loops through each paragraph and looks for styles that need to be textif...
by capvideo
2014-07-31 10:05:54
Forum: Nisus Writer Pro
Topic: Page Break Before in a Style
Replies: 4
Views: 1937

Re: Page Break Before in a Style

Nisus doesn’t have page break before as a style, only as a character that can be inserted.

At least at the moment. You can send feature requests from the Help menu, Send Feedback….

Possible macro solution.
by capvideo
2014-07-29 14:38:41
Forum: Nisus Writer Pro Macros
Topic: NWP macro and AppleScript interoperability?
Replies: 2
Views: 2729

Re: NWP macro and AppleScript interoperability?

Well, since you’re creating the AppleScript within the Nisus macro, you can pass the Nisus array to AppleScript simply by creating it on the fly in your AppleScript string. For the return trip, Nisus gets back the last value generated by the AppleScript as a string. As far as I can tell, it’s the sa...
by capvideo
2010-03-06 13:34:34
Forum: Nisus Writer Pro Macros
Topic: Stacking Windows Macro
Replies: 16
Views: 13056

Re: Stacking Windows Macro

If I understand you correctly, you can do this with AppleScript. tell application "Nisus Writer Pro" set windowList to windows --the focus window is always window 1 --hidden windows are in the list but have their visible set to false --miniaturized windows have their visible set to false --windows i...
by capvideo
2009-11-23 12:49:41
Forum: Nisus Writer Pro
Topic: Foreign language dictionary location and installation
Replies: 12
Views: 8601

Re: Foreign language dictionary location and installation

I just made a simple document: Four score and sevenx years ago, our fathers brought forth on this continent a new nation. Au revoir mes amist! I left the first paragraph as English and marked the second paragraph as French (using the Languages palette). When I chose Edit:Spelling:Spelling Window… it...
by capvideo
2009-11-06 19:25:05
Forum: Nisus Writer Pro
Topic: lines, shapes and boxes
Replies: 1
Views: 2089

Re: lines, shapes and boxes

I can see where text boxes can be a deal-breaker; I'd love to see those, too. (Preferably ones where the behavior is set by styles.) But when it comes to shapes, I've always found it easier to go into a separate drawing program even when using a word processor that supports making their own. Current...
by capvideo
2009-09-23 14:25:12
Forum: Nisus Writer Pro
Topic: Nisus versus the future
Replies: 16
Views: 6707

Re: Nisus versus the future

Macros definitely can be run in a "batch". Ones that themselves only call menus should be a snap. Nisus macros can be called by Applescript. AppleScripts can be drag-and-drop. So making an AppleScript that took every file dropped on it and ran a Macro on each file would be simple. Finding every file...