It makes sense, but the devil is in the details..
From a found set of records a script could use a loop to print this set of documents for each record in turn. The possible problem with that approach is that your script might change that found set as part of the printing process. I can't tell from what you have posted if that's a problem or not.
If it's not an issue, this script can be set up:
#Perform your find first, either manually or with a script
Go to Record/Request/Page [first]
Perform Script [//specify the script that you already have for printing the docs for one person here]
Go to Record/Request/Page [Next ; exist after last]
If it is an issue, there are a number of more complex methods for keeping track of those found records:
- Open a new window for printing your docs and the found set in the original window will not be affected by the script running on data in the new window.
- Set up a second layout based on a different table occurrence of the same table. That list of records in the second layout won't then be affected by the print records script and you can loop through them there.
- Capture the list of ID's for your found set and store it in a variable. Loop through this list of ID's, performing a find for each record in turn before performing the script to print your records. In FileMaker 13, this is an especially easy thing to do as a new summary field makes it possible to get a list of the ID's for all records in a found set.
Thank you the loop and next worked perfectly. The print cue now has 63 pages to go...
Fortunately I already had a separate layout for the found set, So all I had to do was put the loop function in the proper place in the script (at the top instead of the bottom)
I have a few more questions related to this same function but I will post in a separate post (after first searching for a possible previous answer) as not to confuse future readers of the forms (see I learn from making that mistake previously)