Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7265 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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.

Posted

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.

Posted

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

This topic is 7265 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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