Appendix A: The PDFpen AppleScripts

PDFpen and PDFpenPro come with a set of useful AppleScripts that appear on PDFpen’s AppleScript menu when you run PDFpen or PDFpenPro. You can use and modify these scripts for your needs. They perform bulk repetitive actions on one or more PDFs: almost always stuff that you could do by hand but which would be tedious and prone to error.

The Scripts

To use PDFpen’s scripts, you must first populate PDFpen’s AppleScript menu. This menu appears to the right of PDFpen’s Help menu, like so: . However, because of Apple security restrictions, it doesn’t contain any scripts when you first install PDFpen.

To add the scripts, choose AppleScript > Populate Scripts Menu. You only need to use this command once: the Populate Scripts Menu command goes away once you have populated the menu with PDFpen’s scripts. The command requires you to specify a scripts folder in which to store the scripts, but helpfully shows you where to find it (Figure 119).

Figure 119: PDFpen makes finding the Scripts folder easy.
Figure 119: PDFpen makes finding the Scripts folder easy.

The following are the scripts that come with PDFpen and PDFpenPro, along with some brief notes about what they do and how to use them:

  • Combine PDFs: This script combines two or more PDFs into a single document. When you run it from the Scripts menu, the documents must be on the same volume because the script displays an Open dialog in which you ⌘-click to choose the files.

  • Cover Fax Header: This script covers up the unwanted header of a fax. You can choose the amount of space below the top of the page that needs to be covered; you specify how much space is to be covered in 1/72-inch increments. The fax header is not actually erased, but merely covered with an opaque white rectangle.

  • Export Form Data: When you receive an interactive PDF form back from someone to whom you sent it, you can use this script to get the data out of the filled form. The script exports the data to a .csv text file, which can be read by Excel or Numbers. If you know your way around AppleScript, you can change the script to export the data in a different format (see Where to Find the Scripts).

  • Imprint All Pages as First: This places copies of all the imprints on the first page of a document on every subsequent page. The imprints can be text imprints or graphic imprints; they are placed in the same location as the originals on all the other pages. You might use this to place a logo or a running header on every page.

  • Imprint All Pages with Image: This script presents an Open dialog so you can select an image file to place on every page. The image is centered on each page (unless you modify the script).

  • Imprint All Pages with Text: When you run this script, it displays a dialog into which you can enter a short piece of text. The script creates a text imprint that contains the text you entered, and places that imprint, centered, on every page.

  • Merge Every Other: This script interleaves the pages from two PDFs into a single new PDF. For example, suppose you have two PDFs: one with a text in Latvian, and one with the same text in French. With the Latvian PDF open, run this script and, in the Open dialog that appears, select the French translation. The result is a PDF with Latvian-French facing-page translations. Or suppose you are scanning a bound book, first scanning the odd-numbered pages into a PDF, and then the even-numbered pages. With this script, you can put those pages into the proper order.

  • Number Pages Using Bates Numbering: Bates numbering is a convention used for legal and business purposes, in which each page of a collection of documents has a unique page identifier. You supply a page number prefix for a document (for example, “Exhibit 15a”), and the script combines that prefix with a 5-digit page number, which it places at the bottom left of each page. This script is rarely needed for an individual PDF, given the Bates Numbering option in PDFpen’s Edit > Headers, Footers, Page Numbers > Insert command, but it can come in handy should you write workflows to process lots of PDFs.

  • Number Pages: Run this script to place consecutive page numbers at the bottom left of each page. As with the Bates Numbering script described just above, this script is more useful as part of a workflow; otherwise, use the Edit > Headers, Footers, Page Numbers > Insert command for more flexibility.

  • Remove All Imprints: This removes any imprints you’ve added. It’s useful if you’ve modified a PDF and saved over the original. Keep in mind, however, that any edited text objects become imprints, and this script removes them as well, along with any moved or resized image objects. Moral: always keep backups.

  • Reverse Pages: Run this script to reverse the order of the pages in a document. This could be helpful when printing to a printer that doesn’t collate properly, or for a document that is to be bound in right-to-left reading order (such as a Japanese or Hebrew text).

  • Split PDF: Use this script to break a PDF apart, page by page. This script creates a new folder with the same name as the current PDF document, but with ƒ appended to the name, and places the folder in the directory you specify. The script then puts PDF files in that folder, each with a page from the current document. The files have the same name as the original document, but with a 5-digit number appended. The original document is left intact.

Where to Find the Scripts

If you want direct access to PDFpen’s scripts—say, you want to copy them or to view them in the Script Editor when PDFpen isn’t open—you need to find them. The PDFpen family of applications stores its AppleScripts in a folder in your Home directory’s hidden Library folder. The scripts are placed there when you choose the Populate Scripts Menu command from the AppleScript menu.

Where the scripts go in the Library folder depends on which version of PDFpen you purchased:

  • PDFpen from the Mac App Store: ~/Library/Application Scripts/com.smileonmymac.PDFpen11.MacAppStore

  • PDFpenPro from the Mac App Store: ~/Library/Application Scripts/com.smileonmymac.PDFpenPro11.MacAppStore

  • PDFpen from Smile: ~/Library/Application Scripts/com.smileonmymac.PDFpen

  • PDFpenPro from Smile: ~/Library/Application Scripts/com.smileonmymac.PDFpenPro

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.223.160