PyPN is an extension that allows you to use Python to script almost anything in PN. This can be simple text formatting, or complex macros for automation.
See Install PyPN for installation instructions.
After PyPN is installed, go to View > Window > Scripts (or press Alt+F10). You should be able to see the Scripts menu, with the sample scripts listed.
Double click on a line in the Scripts window to run that script.
To edit the scripts, go to “\Program Files\Programmer's Notepad\Scripts” and look at text.py. There you'll see the source code for the sample scripts, and you can add your own. You may have to restart PN to show changes.