Macro to Insert Screenplay Character

Get help using and writing Nisus Writer Pro macros.
Post Reply
User avatar
loulesko
Posts: 124
Joined: 2008-01-20 11:08:35
Location: California
Contact:

Macro to Insert Screenplay Character

Post by loulesko »

This macro creates a list from a paragraph style so the text can be inserted again. The use case is when writing in screenplay format. Some clever people will undoubtedly think of other ways to use this macro. My profound thanks to @phspaelti for guidance on the core aspects of this macro.
Screen Shot 2023-01-16 at 12.04.04 AM.png
Screen Shot 2023-01-16 at 12.04.04 AM.png (199.55 KiB) Viewed 1585 times
Insert Character.nwm.zip
(2.54 KiB) Downloaded 138 times
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Macro to Insert Screenplay Character

Post by martin »

Thanks for sharing your macro Lou. I like the way it uses the existing document content as a sort of database to pull out character names. That's a nice trick! I'll have to keep it in mind since I'm sure it's adaptable to other situations.
User avatar
loulesko
Posts: 124
Joined: 2008-01-20 11:08:35
Location: California
Contact:

Re: Macro to Insert Screenplay Character

Post by loulesko »

Thanks Martin. The only caveat I found—which I think is specific to this situation—the paragraph style is set to Uppercase which is display only in Nisus. Which means (as you know) if a name is typed uppercase or lowercase it will always display uppercase. But .containsValue is case sensitive so I was getting multiple entries of the same name if they were in different cases.

The macro converts the found array item to uppercase before saving to the new array for display in the Prompt Choice window. With everything the same case I can search if the next found item is in the display array so I don't duplicate it.
Post Reply