Skip to content

Save PDFs with one Click in FileMaker

It suddenly came to me that I could probably automate a process I do every time I purchase something for work.

Every time I create a purchase order, I then go to Print and choose “Save as PDF” and then browse to “~/Documents/Purchase Orders/<<Current Fiscal Year Expressed as Hebrew Year>>/<<PO#>> – <<Supplier>>.pdf”

I did a quick second of Googling and found this. So I took that and modified it slightly…

Set Variable [$year; Value:If(Month ( Purchase Orders::Date ) > 6; Year ( Purchase Orders::Date ) + 3761; Year ( Purchase Orders::Date ) + 3760)]

Set Variable [$path; Value:”filemac:/Macintosh HD/Users/<<username>>/Documents/Purchase Orders/” & $year & “/” & Purchase Orders::PO# & ” – ” & Purchase Orders::Supplier & “.pdf”

Print Setup [Restore; No dialog] #Damn Americans don’t know how to spell dialogue

Save Records as PDF [Restore; No dialog; “$path”; Current record]

First it sets the year to 5775 (using the current date 8/8/14). Since I work in a Jewish day school, I organize my files by the Hebrew year. The vast majority of the fiscal year falls into 5775.

Second it sets the $path variable to filemac:/Macintosh HD/Users/<<username>>/Documents/Purchase Orders/5775/1111 – Apple Canada.pdf

This wouldn’t work so well if it was a multiuser database, but I’m the only one who uses it. That file that the fourth step outputs sits in a folder which is synced to our financial administrator’s via BitTorrent Sync.

Tags:

Leave a Reply