Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Create variable file name for pdf's from FMP 7.0

Featured Replies

Greeetings,

I have a heck of a time printing large, complex "reports" so as a bandaid fix, I created a script to save what I want to a pdf. This is acceptable, however, it'd be great if I could get a dialog to come up that asks the user what they want to call the report. It currently saves the .pdf to their Desktop as "FileMakerPrintout.pdf" and will overwrite the last file if it is not renamed.

"Printing Problems script"

Print Setup

Print (as pdf) [Restore, no dialog]

Custom Dialog: "Your print job is on the Desktop, called "FileMakerPrintout.pdf"

The PRINT command needs to be no dialog because my users will not remember to save as PDF, too many steps. Thanks in advance for your suggestions.

You could use AppleScript to accomplish this. Also some plugins exist to change filenames. Show a layout that asks for name to assigned to the pdf about to be created, Print as pdf without dialogue, will save to the last saved name, use applescript or a plugin to change the name defined by user. Search the AppleScript forum to learn how to change the name. Look for plugins for a much easier method but then reliant on a plugin.

On an aside, if you print to a pdf without a dialog, the next time you print without a dialog it will default to save as PDF regardless of how you set the print step in your script.

Here is some info that might help you.

You put a Perform AppleScript step in your printing script, with the following parameters:

tell application "FileMakerPro" to set myPDFName to cell "PDFoutput" of current record

tell application "Finder" to set the name of file "pathname:FMPdatabaseName.fp5.pdf" to myPDFName & ".pdf"

You need to set up the print options in the script to generate a PDF, and save that with the script; the default file name for such a PDF would be "pathname:FMPdatabaseName.fp5.pdf". The FM script generates a PDF with the default name. The AppleScript called in this ScriptMaker step takes renames the file to the contents of the field PDFoutput, which you could make a global, hidden field that would make the name the same every time. I use a script to generate 25-30 PDFs in succession (because I am switching layouts), and I use the contents of a field to rename them so I can tell them apart, and then combine them in Acrobat into one large file.

I don't know enough about AppleScript to make the pathname generic to work on any Mac, though! But hopefully this will give you an idea of where you might start.

There are a few generic places that AppleScript knows. A useful one is the Shared folder, in the Users folder. That should be the same, and be accessible for all users:

set theUsers to path to users folder as string

set sharedFolder to alias (theUsers & "Shared:")

Another is the temporary items folder:

set theTemp to temporary items

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.