all you need to do have a script start on a layout that lists each unique record you want to print...
use a structure like
goto first record
goto related record (using a layout specifically for printing an invoice)
set variable to a unique file identifier such as invoicenumber
save as pdf and set filename to previous variable
goto original layout
goto next record (exit after last)
I am a little confused. (New to the database and filemaker). Here is what I have
I have a layout setup specifically for generating the PDF,
I have a button that I have setup up to run a script, the script under script manager is like this:
Go to layout
Save records as PDF[restore; current record]
Go to layout
This script runs it brings up the save dialog box. How would I write the script to automatically enter informaiton from 3 or 4 of the fields on the PDF layout into the save as dialog box and save.
mwc hit the nail on the head...I'm only chiming in because you mentioned in a previous post that you are a beginner at understanding writing scripts.
In the script that mwc references, it looks like you'll need only part of it. The concept is right on, though: (# means side comment, not a functional part of the script)
# you need to trap your filename and pathname into variables
Set Variable [ $Field1ofDesiredFileName ; Field1 ]
Set Variable [ $Field2ofDesiredFileName ; Field2 ]
Set Variable [ $Field3ofDesiredFileName ; Field3 ]
# trap your filepath into a variable too and add the composite filename(have a global field with your filepath)
# the field "FilepathforPC" would be the path you're currently using
Set Variable [$TargetFile ; FilepathforPC & $Field1ofDesiredFileName & $Field2ofDesiredFileName & $Field3ofDesiredFileName ]
# then save your record by naming it using the variables from above
# if you want to do multiple records at once, make sure you have only the records you want to pdf in your found set and replace "Current Record" with "Records being Browsed"
Save Record as PDF [ No dialog ; "$TargetFile" , Current record ]
How does this work for you?