How To Customize PSPad For MX PDF
How To Customize PSPad For MX PDF
Templates
You can specify one or more templates for your MX Input Files.
If you create a new file in PSPad using the toolbar icon, and directly define that the new
file shall be a MX Input File, then the default template for MX Input Files will be used.
A template is a simple text file, which can contain as much text as you want.
The file must have the correct suffix and must be stored in the folder:
...\PSPad\Templates\
Syntax Highlighting
The Syntax Highlighting is controlled by the *.def file. This file stores the definition of the
MX Command Language, like the file filter (*.inp, *.pss, etc…) and the keywords (major
and minor options).
This file must be stored in the ...\PSPad\ Context\ folder.
For MX for example: C:\Program Files\PSPad\Context\MX Command Language.DEF
Clip Definitions
Clip Definitions are pieces of re-usable text which you can easily insert into your text files.
Clip Definitions are stored in *.INI files, where the filename must match the name of the
Syntax Highlighting file. Clip Definitions must be stored in the ...\PSPad\Syntax folder.
For MX for example: C:\Program Files\PSPad\Syntax\MX Command Language.INI
Scripts
PSPad provides scripting functionality (JScript and VBScript). You can write scripts to add
extra functionality to PSPad or to automate tasks.
I’ve written some VBScript functions which provide the following functionality:
I think most of these functions are pretty self-explaining. From bottom to top...:
• Run selected lines... will send those lines to MX which you currently select in your
MX input file – so it’s a bit like firing individual linemode options in MX (“View >
Linemode”), but more flexible since you have all the Editor functions available, can
simply select any part of an existing input file, can easily copy&paste...
• Run active input file... does precisely that – the currently active file is run in MX.
(you can also do that using the input file runner)
• Run all open files... will run all open files in the order of the file tabs from left to
right.
You can change the order of the tabs using drag and drop and thus change the
order in which the files are run.
Installation instructions:
• (Re)Start PSPad;
• Select in the list on the left hand side the item “<not assigned>”, click on the tab
“Specification” and select “MX Command Language” in the User Highlighters list;
The word “<not assigned>” in the list on the left hand side now should have
changed to “MX Command Language”;
• You can select browse and select the Linemode help file (e.g. C:\Program
Files\Bentley\MX\MFW\xx_help\mxfnlinemode.chm) to get context sensitive help;
• Click on OK!
2) PSPad doesn’t recognize three zeros or three spaces as start of a comment line.
Therefore “//” has been chosen as ‘comment style’, i.e. comment lines must start with “//”
for PSPad to recognise them as comment lines.
Examples:
000 PSPad doesn’t recognise this line as a comment line
This is also not recognised as a comment line.
// but this line is recognised – shown in green by default
000// this too is a comment line
3) The Code Explorer (Tools > Code Explorer) allows you to navigate fast thru your text
file – if you use certain tags/anchors in your input file (see screenshot on the next page).
The code explorer lists all anchors which you add. Clicking on an anchor in the code
explorer will take you that position in the text.
To insert templates or “clips” into your input file you simply need to press CTRL + Space
(or go to Tools > Show Clips). This will show a list with all the clips in the clip definition
file. The list will be filtered when entering some characters. Following screenshot shows all
minor options in the clip definition file which start with “10”.