This PaintShop Pro script prompts the user for a set of grid dimensions (rows and columns) as well as a border width (in pixels). Based on these inputs, the script automatically generates a grid of masks with a border between them based on the original dimensions of the image.
See an example of its use here:
Tile Masking VideoOnly tested in PaintShop Pro 2020 and X9 on Windows 10, however, other versions may be compatible.