I'm sure that there is, but the devil is in the details--most of which are missing from your post.
What is the end result of what you are trying to produce here?
How is your data organized in your database?
What problems are you solving by putting this data in variables instead of leaving it in fields and records of your database?
This post has an image of the script. The next post is the end result.
The way this is constructed if a field is empty the horizontal line closes up.
Here is the second image
That would seem to leave this question unanswered: "What problems are you solving by putting this data in variables instead of leaving it in fields and records of your database?"
I don't see why you wouldn't use a list view layout with each row a different record instead of using a script, multiple fields in the same record and variables--which would appear to be a much more complicated way to do something that would otherwise be quite simple to set up.
I also can't match the variable names in your first post to those used in your script.
I am unsure how you would do this as a list view.
I have the main table Clients with related tables Products, Finances, Properties, and Insurance.
Each Client could have anywhere between 0 and 25 items per table.
Many times there will be more than one table per page.
There are paragraphs of information from the Client table between the listings.
The final result is a PDF.
Is there a way to have a list view of more than one table per page?
The variable names in my first post was a simplier version.
This is an example of a page. There is information from 3 tables here.
You appear to be using FileMaker as a desktop publishing system. That can be frustrating as there are inherent limitations to what FileMaker can do. Some developers end up exporting the data to MS Word or other software to get the results that they need.
But what I see here, looks like something that may be possible to set up with a list view layout where each row of data in your "tables" is one record in the table on which you base your layout. The data above/below each table can be placed in sub summary layout parts to serve as a "sub header/sub footer" for the listed items in each "table".
Depending on the version of FileMaker that you are using, the vertical borders shown, however, may be tricky to produce in a manner that looks right.