blog

How To Automate PDF Actions in PDFpen using AppleScripts

applescripts
Source: Unsplash

PDFpen supports AppleScripts. In PDFpen, you have a selection of AppleScripts readily accessible via the Scripts menu. Here is the full list.

Putting a business stamp on a three-page document is easy. But what if you had to do it to a one-hundred-page report? Here’s where automation would help you.

When we talk about automation in PDFpen, what we're really talking about is AppleScript. AppleScript is a scripting language created by Apple to help Mac users streamline repetitive tasks. In PDFpen, you have a selection of AppleScripts readily accessible via the Scripts menu.* Using them doesn't require programming knowledge or experience, so read on to see the full list of Scripts and how you can use them.

Populating the AppleScript Menu

*In versions of PDFpen running on Lion, Mountain Lion, Yosemite, or later, under Apple rules, you have to populate the script menu yourself. Here's how:

1. Launch PDFpen or PDFpenPro.
2. Locate the AppleScript menu

AppleScript


3. Select "Populate Scripts Menu."
4. Immediately press "Select Folder."

PDFpen already found the folder for you. It just needs you to select it. That should be all you need to do to populate the menu.

If the above steps are not what you see, try the following:

1. Click on Populate Scripts.
2. In the window, note the small instructions:
"Tap c to make selection."
3. Go ahead and click on "c" on your keyboard.

The menu will automatically select a folder: com.smileonmymac.PDFpen or com.smileonmymac.PDFpenPro (in the Applications Scripts folder). Now choose "Select Folder." Shut down PDFPen, and restart it again. Menu items should now appear under the AppleScript menu.

Full List of PDFpen Scripts

Read a brief description of each script below.

Screen-Shot-2020-03-16-at-17.22.47

Merge Every Other
Sometimes, scanning a book leads to two PDFs, one with left-hand pages and the other with right-hand pages. Combine the two PDF files into one – in the correct order – with the "Merge Every Other" script.

Imprint All Pages As First
The fastest way to add the same text or image to every page in a PDF is to use "Imprint All Pages As First." Add the imprint to the first page of your document; then, with one click, replicate it in all the remaining pages.

Combine PDFs
Merge multiple PDFs.

Cover Fax Header
Cover up the unwanted header of a fax.

Export Form Data…
Export form data in CSV (comma-separated value) format.

Imprint all Pages with Image
Place one image on every page.

Screen-Shot-2020-03-16-at-17.35.26

Imprint all Pages with Text
Place a selection of text in the center of each page of a document.

Number Pages using Bates Numbering & Numbering Pages
Quick add numbers to pages.

Remove All Imprints
Remove comments, images, and other objects you added to a PDF.

Reverse Pages
Reverse the document page order so that the last page is viewed first and the first page is viewed last.

Split PDF
Turn each page of a PDF into a separate document.

Tip: Do you use Automator? You can place Automator workflows in the AppleScripts folder.

Customizing AppleScripts

Screen-Shot-2020-03-16-at-17.27.56

Smile offers PDFpenPro free of charge to members of the ACN, or Apple Consultants Network. An ACN member can help you create a custom AppleScript solution for your specific needs.

PDFpenPro users have created AppleScripts to automatically fill out W-9 forms and add a header to the first page of all PDF documents. There is also a Script for creating templates for documents you frequently use, and two for automatically performing OCR on documents—this one, which combines AppleScript with a folder action, and this one, which uses Hazel.

To view the source of any script, hold the Option key and select the script from the AppleScript menu.

Automate PDF actions with AppleScript today

PDFpen includes extensive AppleScript support so that it's possible to automate the PDF manipulation process. Example scripts are included with the application. To automate PDF actions and more at no charge, download a 30-day free trial of PDFpen.