Automatic naming of pdfs - FM8

General support questions.
Posts: 58
Joined: Tue Jul 26, 2005 12:08 pm
Location: London
PostPosted: Tue Jun 20, 2006 4:19 am
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.

David
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Tue Jun 20, 2006 5:50 am
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.
John Sindelar
SeedCode
Posts: 58
Joined: Tue Jul 26, 2005 12:08 pm
Location: London
PostPosted: Sun Jun 25, 2006 4:58 am
Thank you very much John. Works a treat!

All the best,

David

Return to General Support

Who is online

Users browsing this forum: No registered users and 2 guests

(855) SEEDCODE
[email protected]
Follow us: