Search found 992 matches

by phspaelti
2019-08-17 03:24:24
Forum: Nisus Writer Pro Macros
Topic: Macro to assign style
Replies: 6
Views: 438

Re: Macro to assign style

Re 2: the command you need would be

Code: Select all

$paras.appendItemsFromArray $charas
99% I’m typing this from my phone
by phspaelti
2019-08-13 18:09:46
Forum: Nisus Writer Pro
Topic: Space around lists, quotations, etc.
Replies: 23
Views: 1288

Re: Space around lists, quotations, etc.

Hello Adrian, While I understand what you are trying to do here, I really think that once you get into the thick of using macros to accomplish such complex tasks, you should get over your aversion to using the macro language. Basic Find and Replace is fine for simple editing macros, and making selec...
by phspaelti
2019-07-24 06:22:41
Forum: Nisus Writer Pro Macros
Topic: Normal to Body Text
Replies: 6
Views: 869

Re: Normal to Body Text

Here is how I would use the macro language to solve this problem: # Select First Paragraph of Each Selection Block $doc = Document.active $sels = $doc.text.find $doc.styleWithName('Normal'), 'a' $firstParas = Array.new foreach $sel in $sels $firstParas.push TextSelection.new $sel.text, $sel.text.ran...
by phspaelti
2019-07-21 20:06:59
Forum: Nisus Writer Pro Macros
Topic: Normal to Body Text
Replies: 6
Views: 869

Re: Normal to Body Text

Hello Todd, Assuming you want hints about how to solve this rather than a fully written out solution, let me suggest this. Start by giving all Body Text the same style. If you select these, then you will have an array of selections. The index/location of each selection block is the index of the firs...
by phspaelti
2019-07-09 16:01:35
Forum: Nisus Writer Pro
Topic: Automatic numbers lost in sort Table
Replies: 11
Views: 1526

Re: Automatic numbers lost in sort Table

I don't really need the word 'Scene' at the start, would tha help? Exactly. "Numbers" of the form "Scene 1" are sorted alphabetically. So "Scene 101" will precede "Scene 25" which will precede "Scene 9". They would need to be 0-padded to sort correctly. But if you remove the "Scene " then they will...
by phspaelti
2019-07-06 04:47:48
Forum: Nisus Writer Pro
Topic: Variable substitution
Replies: 3
Views: 1072

Re: Variable substitution

This type of thing can be done via the macro language. The detailed features of the macro language can be found in the Macro Language Reference which is in the Help menu. For example you can get the name of the current font like this: $sel = TextSelection.active $currentFont = $sel.displayTypingAttr...
by phspaelti
2019-06-10 20:17:17
Forum: Nisus Writer Pro
Topic: Find / Copy all hyperlinks in document
Replies: 2
Views: 1272

Re: Find / Copy all hyperlinks in document

Hamid, what a quaint macro :wink:

Here is something that should do what Sccardais actually asked for.
(Note: Working with links is surprisingly cumbersome.)
by phspaelti
2019-05-24 23:45:06
Forum: Nisus Writer Pro
Topic: Pages inside a Document
Replies: 10
Views: 4717

Re: Pages inside a Document

Do you want to be able to see inside the pdf while viewing the Nisus document? Otherwise you could just put links to the pdfs into the file. Clicking on them will open them in the pdf viewer (e.g. Preview). If you really need the first option you could put images of pdf pages into the Nisus document...
by phspaelti
2019-04-28 10:43:51
Forum: Nisus Writer Pro
Topic: Changing selected fonts
Replies: 2
Views: 1852

Re: Changing selected fonts

Apply the font :?
by phspaelti
2019-04-21 06:50:45
Forum: Nisus Writer Pro
Topic: Applying a template to an existing document
Replies: 4
Views: 2095

Re: Applying a template to an existing document

I am sure a Nisus Writer Pro macro would solve the problem... Not sure this is the best solution, but … # Save Current File With Template $doc = Document.active $docPath = $doc.filepath $dmPath = User Property “document manager folder path” $templatePath = $dmPath.filePathByAppendingComponent "MyTe...
by phspaelti
2019-04-21 01:07:07
Forum: Nisus Writer Pro
Topic: Applying a template to an existing document
Replies: 4
Views: 2095

Re: Applying a template to an existing document

It's true that you can't apply a template to an existing file. And while you can easily replace the style sheet of an existing file, you can only change the margins etc. by hand through the settings in the palette. On the other hand what you can do easily is import a document into a (template-based)...
by phspaelti
2019-04-13 19:53:37
Forum: Nisus Writer Pro
Topic: creating and inserting a word index in a completed document
Replies: 7
Views: 2762

Re: creating and inserting a word index in a completed document

Hello Walt, your list should be in its own document, and it should contain a table with two columns; the first column should have the words to be indexed in your main document, and the second column should have the term under which they should be indexed. If you have created the list as lines with t...
by phspaelti
2019-04-13 18:30:34
Forum: Nisus Writer Pro
Topic: creating and inserting a word index in a completed document
Replies: 7
Views: 2762

Re: creating and inserting a word index in a completed document

Hello Walt, The "two column" file you need for generating an index should be a two column table . Note that the list you use should only contain words you actually want to index. With 20,000 words it sounds like you would be indexing every single word in the document (but maybe that's what you want?...
by phspaelti
2019-04-09 04:12:10
Forum: Nisus Writer Pro
Topic: How to search for a 1 cell table
Replies: 5
Views: 2277

Re: How to search for a 1 cell table

vwnisus wrote:
2019-04-09 03:19:15
The intention is to remove the text and the table.
Well in that case, use the first macro and press "delete". Though that might result in merged paragraphs. So maybe better:

Code: Select all

foreach $table in reversed $oneCellTables
  $table.enclosingText.replaceInRange $table.enclosingTextRange, "\n"
end
by phspaelti
2019-04-09 02:35:59
Forum: Nisus Writer Pro
Topic: How to search for a 1 cell table
Replies: 5
Views: 2277

Re: How to search for a 1 cell table

For instance you could follow up the code above with the following: foreach $table in reversed $oneCellTables $cell = $table.cellAtRowAndColumn(0,0) $cellText = $cell.text.copy & "\n" $lineAttrsTop = $cell.lineAttributesForEdge 'top' $lineAttrsBottom = $cell.lineAttributesForEdge 'bottom' $lineAttrs...