Jump to content

Creating a PDF w/applescript


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

Recommended Posts

I'm working with FM 6 unlimited and OSX.2 server. The probelm that I'm having is at I can not script printing to pdf. PrintToPDF does not work with OSX. I looked on Adobes website and they do not have PDFWriter for OSX either. Here is my question. In preview mode how can I create a pdf file using applescript?

Link to comment
Share on other sites

How to save setting for printing to PDF for OSX.2

CREDITS:

Vincenzo P. Menanno

Waves in motion

THIS IS ONLY FOR OSX.2

This will show you how to save settings for printing to PDF. This way you can use the print function in a FileMaker script. and print to a PDF.

The print settings will only behave in the application that they where save in. The setting will appear in other application but will not behave the same.

Step 1.

Open your FileMaker file you want to print from.

First we need to save setting for your current printer, if you have one.

Step 2.

Go to the File pull down menu and select "print". This window will appear.

Step 3.

Click the "Presets" pull down and select "Save As".

Step 4.

Rename, as you like. I named it Printer. Click the "OK" button

You just made printer setting for your printer.

Now lets make setting for printing to PDF.

Step 1.

Switch the "Presets" back to Standard.

Step 2.

Select "Output Options" from the "Copies & Pages" pull down.

Step 4.

Click the "Save as file" check box and make sure the "Format" pull down reads PDF.

Step 5.

Click the "Presets" pull down and select "Save As".

Step 6.

Rename, as you like. I named it PDF. Click the "OK" button

Step 7

Now you have created setting to print to a PDF.

You just made printer setting for printing to a PDF

How to print a PDF in a FileMaker scirpt

Step 1.

Open your FileMaker file you want to print from.

Step 2.

Go to the File pull down menu and select "print". This window will appear.

Step 3.

Click on the Presets pull down and select the new settings for

pirnting to PDF you just created.

Step 4.

Click the "Save button".

Name the file what you want.

Select the directory where you want to save the file.

Step 5.

Now create your script in FileMaker to print with no dialog.

Note: Every time you run this script with these setting the

PDF will over write the previous file.

To print to your printer again, click on the "Presets" pull down and select

The new settings you created for your .

If you want pictures to go along with the steps. download the attachment.

Todd Dignan

New Techniques

[email protected]

Link to comment
Share on other sites

  • 2 months later...

Thanks for the info. Its very helpful!

Do you also know how to use the content from a FileMaker field to re-name the pdf? I would like to have my internet users trigger the creation of a pdf report (in-line action or script), which would then be e-mailed to them as an attachment. I don't want it to be written over by a subsequent request before the e-mail is sent.

Thanks in advance for your help!

Link to comment
Share on other sites

Following the above procedure will place the file in a know location. To have filemaker field content used to rename the file, your script would be something like...

set theKnownPath to "MacHD:Reports:Temp Name.pdf"

tell app "FileMaker Pro" to set the newName to cell "Name" of current record

tell app "Finder" to set the name of file theKnownPath to newName & ".pdf"

Link to comment
Share on other sites

This topic is 7824 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.