saveblocks (Save Blocks)

Screenshot of the Save Blocks Plugin
Internal Name:

saveblocks

Plugin Type:

function

Description:

Saves all sections between markers, each into a separate file. Each file is given a name that can be customized by using a pattern that can contain the original file name, an index and the number of sections.

It is also allowed that the file name pattern contains forward slashes as path separators, which allows saving the sections into different sub directories. Please note that all whitespace characters around such path separators are silently removed, to avoid creation of directory names which begin or end with a whitespace.

Parameters:
name

The name of the original file, will be used as base name for the file names.

pattern

A pattern that will be used for creating the names of the files. It can contain the following wildcards which will be replaced by the corresponding content when creating the final file name:

wildcarddescription
[%nr] Will be replaced with the current index of the file to save.
[%count] Will be replaced with the number of sections that will be saved.
[%total] Will be replaced with the index of the last file to save.
[%filename] Will be replaced with the base file name, without path and without extension.
[%fileinfo{keyword}] Will be replaced with the content of a file information identified by keyword. See section File Info for a list of all available keywords.
[%title] Will be replaced with the title the block, which is taken from the descriptive text of the label at the start of the block. If that text is empty it will fall back to the title of the file (see file information item "Name"). If this also does not exist, it will fall back to the base file name as described above.

All numeric wildcards can also contain a numerical argument after the "%" and the identifier, to force a certain number of digits. If the number is preceded by a 0 then the result will contain leading zeroes, otherwise it will contain leading spaces.

Example: [%04nr] produces a number between 0001 and 9999.

numbering mode

Determines where the numbering should start.

valuedescription
0 Continue after the index of the highest index that already exists, this avoids overwriting existing files.
1 Always start with index 1, with the risk of overwriting existing files.

selection only

valuedescription
0 Save all sections of the whole file.
1 Save only the sections that are within the current selection. If nothing is selected, the whole file will be saved.