Search found 33 matches

by johseb
2020-08-25 06:37:36
Forum: Nisus Writer Pro Macros
Topic: Macro command to Import from Style Library…
Replies: 8
Views: 5273

Re: Macro command to Import from Style Library…

Have you tried granting access to the specific file you are going to use (Case Report.rtf)? The message reads "file doesn't exist" so it seems to expect a file. In any case the Macro Reference suggests to use the built-in macro "Manage Macro File Access" to grant access once and for all. For instanc...
by johseb
2020-08-25 01:29:04
Forum: Nisus Writer Pro Macros
Topic: Highlight paragraphs with border(s)
Replies: 8
Views: 1139

Re: Highlight paragraphs with border(s)

Philip, that is really ingenious! Thanks again; the macro now works perfectly. Here it is in the final form if anyone else is interested: $doc = Document.active $paras = $doc.text.find('^.+\n','Ea') $green = Color.green $highlightedParas = Array.new foreach $para in $paras $attr = $para.text.display...
by johseb
2020-08-24 01:56:21
Forum: Nisus Writer Pro Macros
Topic: Highlight paragraphs with border(s)
Replies: 8
Views: 1139

Re: Highlight paragraphs with border(s)

Thanks Philip, very instructive. So, given that paragraphLineAttributesForEdge returns a LineAttributes object, I guess I can write something like: if $attr.paragraphLineAttributesForEdge('top').lineType == "Solid" or even (to detect any type of border): if $attr.paragraphLineAttributesForEdge('top'...
by johseb
2020-08-23 14:40:55
Forum: Nisus Writer Pro Macros
Topic: Highlight paragraphs with border(s)
Replies: 8
Views: 1139

Re: Highlight paragraphs with border(s)

Hi philip, thanks for your constant support on the forum! At this point only @martin can probably throw some light on the matter. Building a macro is not an easy task. Once a year, maybe less, I put togheter a few pieces of code stolen here and there but I must admit that I never got to grasp the la...
by johseb
2020-08-23 08:47:27
Forum: Nisus Writer Pro Macros
Topic: Highlight paragraphs with border(s)
Replies: 8
Views: 1139

Highlight paragraphs with border(s)

I'm trying to write a simple macro that checks every paragraph of the open document and highlight it if the paragraph has one or more borders. Here's my first attempt: $doc = Document.active $paras = $doc.text.find('^.+\n','Ea') $green = Color.green forEach $para in $paras $attr = $para.text.display...
by johseb
2020-03-23 17:19:35
Forum: Nisus Writer Pro
Topic: Content in table row to continue next page?
Replies: 3
Views: 1111

Re: Content in table row to continue next page?

+1 for this feature request. It would be also very useful to have 1. An option to repeat table header on each page (for tables spanning multiple pages). 2. Ability to add text with vertical baseline; I don't know if the description wording is correct so here's an example: Screen Shot 2020-03-24 at 0...
by johseb
2019-09-26 10:01:07
Forum: Nisus Writer Pro
Topic: Line spacing when using Combining Diacritical Marks
Replies: 22
Views: 8572

Re: Line spacing when using Combining Diacritical Marks

Please try selecting the character fully. If there's no selection and you just have an insertion point (caret) the palette won't show that any font substitution has occurred, because no character is actually selected. Selecting the character inside a table gives the correct result for me as well bu...
by johseb
2019-09-26 02:53:54
Forum: Nisus Writer Pro
Topic: Line spacing when using Combining Diacritical Marks
Replies: 22
Views: 8572

Re: Line spacing when using Combining Diacritical Marks

Martin,
in regards to Formatting Examiner's ability to detect font substitution I made a quick test (using OP's document).
It seems that FE is detecting the substituted font for main text but not for text inside the table.
Am I missing something?
by johseb
2019-09-10 01:19:25
Forum: Nisus Writer Pro Macros
Topic: Find/replace in each paragraph of the selection
Replies: 10
Views: 5859

Re: Find/replace in each paragraph of the selection

Philip,
thanks again for all your detailed and clear explanations!

I'm sure they'll be useful for other beginners taking their first steps in NWP macro syntax.
by johseb
2019-09-09 06:19:07
Forum: Nisus Writer Pro Macros
Topic: Find/replace in each paragraph of the selection
Replies: 10
Views: 5859

Re: Find/replace in each paragraph of the selection

Hi Philip, I'm making slow progresses thanks to your help. 1. Find in Selection - Method 1. I'm afraid I don't understand your hint. Could you please give a worked out example? - Method 2: I agree with you it's a bit convoluted - Method 3: that worked perfectly so it's presently my go-to method. I j...
by johseb
2019-09-09 00:43:31
Forum: Nisus Writer Pro Macros
Topic: Find/replace in each paragraph of the selection
Replies: 10
Views: 5859

Re: Find/replace in each paragraph of the selection

Hi Philip, thanks for the thorough expalanation and step-by-step construction of the macro; really helpful (especially the tip about processign the array in reverse order). I have a couple of remarks: 1. The macro acts on the entire file and modify all bits of text matching the regex. I would like t...
by johseb
2019-09-08 15:12:06
Forum: Nisus Writer Pro Macros
Topic: Find/replace in each paragraph of the selection
Replies: 10
Views: 5859

Re: Find/replace in each paragraph of the selection

Hello Philip, thanks for your reply. The code I posted is just the first step in building a macro that should perform a replace with a variable string based on user input (i.e. the macro should check user input against the number at the end of each line). For the time being it would be enough to und...
by johseb
2019-09-08 13:58:03
Forum: Nisus Writer Pro Macros
Topic: Find/replace in each paragraph of the selection
Replies: 10
Views: 5859

Find/replace in each paragraph of the selection

A document of mine contains some text like the following (there's a tab between the text and the number; apparently forum sw doesn't allow it): Some text 12 Other text 43 Some more text 62 etc I would like to select all that lines and run a macro that adds a prefix and suffix to each line—two fixed ...
by johseb
2019-08-30 14:27:59
Forum: Nisus Writer Pro
Topic: Table Format for Sort by date?
Replies: 31
Views: 12264

Re: Table Format for Sort by date?

A different approach probably better suited for the specific OP need could be: 1. Develop your table in NWP as you did using ISO dates (YYYY-MM-DD) that allows sorting 2. At the end of the work select and copy the date column of NWP table 3. Paste in a spreadsheet and change the format to something ...
by johseb
2019-08-30 14:08:10
Forum: Nisus Writer Pro
Topic: Table Format for Sort by date?
Replies: 31
Views: 12264

Re: Table Format for Sort by date?

A viable solution is to use a spreadsheet to create the table content (maybe copying form an external source), manipulate it as needed and then copy to NWP. It works quite well using Excel; a table is automatically created on pasting in NWP (even though with invisible edges that you then need to mod...