06 Jun

Build your own PDF exporting droplet for Pages

In this tutorial, I’m going to show you how to use our Pages Automator Actions to create a PDF exporting droplet for Apple’s Pages word processing app. If you want to follow along, you’ll need a copy of Pages, Automator (in the apps folder of all fairly recent Macs) and a copy of Pages Automator Actions.

If you’ve not used Pages Automator Actions before, you’ll need to open it from your Applications folder so it can add its actions to Automator. Once you’ve done that, you can close it and you’ll never need to open it again.

Create a new app

Open Automator (you’ll find it in your Applications folder), create a new document and select “Application” in the menu that appears.

Add the actions

Select “Pages” from the left hand section of the window and drag the actions in as shown in the screen shot below. Note that “All documents” is selected in all of them – don’t forget that!

The first action will make our app open any of the documents dropped on it in Pages. The second will export all open documents as PDF files. The PDFs will be in the same location as the Pages files used to create them – with a .pdf file extension, of course!

Save your app

Save the app somewhere you’ll be able to find it, e.g. your desktop. Make sure the File Format is set to “Application”. Once you’ve saved your app, you will be able to drop one or more PDFs on it and they’ll be automatically turned into PDFs!

Note: There was a bug in some earlier versions of Pages which might have given a permissions related error when doing this. If you have errors, make sure you’re running the latest version of Pages.

And there’s more…

Automator actions for Pages has actions for exporting PDFs, Word, RTF and more handy actions to help you create cool apps, workflows and services.

Why not get your copy today and start automating Pages the easy way, for only $14.99*

* or near local currency equivalent

16 Mar

macOS Sierra: Export PDFs from Pages using AppleScript

It appears that macOS Sierra introduces a bug in Pages which means that you get a sandbox/permissions related error when trying to export a PDF using AppleScript.

Hopefully, Apple will fix it soon. However, until then, here’s a workaround (see sample below in a handler suitable for Automator).

The idea is to take advantage of the fact that the Pages file is a package (in effect, a folder) and temporarily save the PDF there, having done that, we move it to its correct location using the Finder. Scruffy, but it works.

on run {input, parameters}

repeat with theFile in input
tell application "Finder"
set theFilesFolder to (folder of theFile) as text
end tell

tell application "Pages"
set theDoc to open theFile

set theDocName to name of theDoc
set theName to (characters 1 thru -7 of theDocName) as text
set thePDFPath to ((theFile as text) & theName & ".pdf") as text
export theDoc to thePDFPath as PDF
close theDoc

end tell

tell application "Finder"
move file thePDFPath to folder theFilesFolder with replacing
end tell

end repeat

end run

While we have your attention… why not check out our macOS apps?

Barcode Basics – macOS barcode generator (including Automator support)
Ai Actions – Automator action pack for Adobe Illustrator
Pages Automator Actions – Automator action pack for Pages