Page 1 of 1

Automatic naming of pdfs - FM8

PostPosted: Tue Jun 20, 2006 4:19 am
by David Fox
Hi All,

I have a client who wishes to keep a permanent pdf record of the invoices printed from his FM8 database.

The client will normally print 200 invoices at month end.

I have created a looping script using FM8 Save Records As Pdf script step. However, these invoices must have their unique invoice number as part of filename under which they are saved. I have got the script to the stage where it will copy the relevant invoice’s number to the clipboard and this can be pasted into the ‘File name:’ bit of the Save Records as PDF dialogue box by using the ‘Ctrl V’ keys as it creates each pdf.

However, it is a bit tedious to do this for every invoice record pdf as it loops through 200 invoice records.

As it is Filemaker that is creating the pdfs and not an external application is there a Custom Function or script step which will automatically paste the invoice number data into the ‘File name:’, initiate the ‘Save’, then move onto the next invoice as part of the looping script?

All the best and thank you as always.


PostPosted: Tue Jun 20, 2006 5:50 am
by John Sindelar
As part of your looping script set a variable ($FileName) to a path ending in the desired pdf name, something like:

"file:" & Get ( DesktopPath ) & InvoiceNumber & ".pdf"

Then use this variable instead of a hard coded file name in the Save Records as PDF script step. This will let you run that script step without a dialog.

PostPosted: Sun Jun 25, 2006 4:58 am
by David Fox
Thank you very much John. Works a treat!

All the best,