34.8.4.6 Constructing file names from multiple paragraph formats
Suppose you split files on both Heading1 and Heading2 paragraph formats, and you want each Heading2 split-file name to be prefixed by the content of the preceding Heading1 paragraph. You can use the TextStore property to capture the content of each succeeding Heading1 paragraph, and make that content available to all Heading2 split files up to the next Heading1 paragraph:
ChapterTitle = Split Title FileName
Heading1 = Split Title FileName TextStore
Heading2 = Split Title Filename
Heading2 = <$($$Heading1 replace " " with "_")>_
The TextStore property uses the format name by default for the name of the variable it creates (see §28.3.7.1 Capturing paragraph content with the TextStore property), so you can simply specify $$Heading1 in the prefix value. You can use a macro expression to replace any spaces in Heading1 content; see §28.6.5 Specifying substrings in expressions.
> 34 Automating Mif2Go conversions > 34.8 Renaming output files for automated systems > 34.8.4 Using paragraph formats to name output files > 34.8.4.6 Constructing file names from multiple paragraph formats