Hi. A couple of comments and then I've posted a screenshot of a sample script.
1. Make sure you move your Go to Record/Request/Page [First] before you start your loop or you will end up in an endless loop, because the way you have it at the moment its going to keep going back to the first record at the beginning of the loop.
2. I find it easier to set the pdf filename as a variable and then use that in specifying the filename variable. Then you use the filename variable in the save records as pdf and in the send email steps.
3. You can actually specify the Save Records as PDF with an option to open the pdf in an email after it has created it, but I prefer having the send mail step as an explicit separate step.
4. Make sure your "Send Mail" options are set to Create: One email using data from the current record.
Many thanks Chris.
This is gets right to the heart of my problems. However there is a glitch. When I set the script up as you suggest the first email comes out as intended with the correct address and attachment but for the next email whilst the correct party is addressed the pdf attached is that which was created for the first record. Is there something else I need to do to refresh the temporary path. Repeating the Save Records step after the Go to Next Record step didn't make any difference.
A separate issue is that when the message gets to Mail the attachment is placed prior to the message. That may be something due to the set up of Apple Mail rather than Filemaker. Not sure but it is minor issue.
I think I may have solved the problem. If I add another $ symbol in front of FilePath to make it globally available it seems to work as intended. I will have to set up live performance to be sure.