![]() ![]() Quick ActionsĪdds a blank page to the end of a PDF file.Īdds the text "n of x" to the first page of all selected PDF documents, where x is the total number of PDFs, and n is a sequential index. The Suite also includes some Quartz Filters, which can apply various transformations to PDF files, such as PDF/X-3 compliance or reduced file size.Īpple used to include Automator actions containing python scripts that provide some (but not all) of these functions - however, PDFSuite python scripts are faster, better and more easily configured for different uses than Apple's own actions! They also serve as useful algorithmic examples of how to use Apple's APIs, which may benefit programmers working in any language. They may need further work for other purposes. (Drag the script file onto a Terminal window then drag the PDF files you want to the same window then press Enter!)Ī few scripts take more complex arguments and so will only work as Unix shell scripts. They are found here in the Automator_Scripts folder. The bare scripts can also be run directly in a Unix shell (Terminal), taking one or more PDF files as their argument. See the ReadMe in the subfolder for installation instructions. They will then be available in the PDF button of the print menu. PDF Services should be installed in the /Library/PDF Services folder (or the top-level /Library/PDF Services folder). Earlier OS versions will need to create their own Automator workflows from the bare python scripts. NB: Quick Actions were introduced with MacOS 10.14 Mojave. The scripts used in Automator can also be run in the Terminal with filenames as arguments. Quick Actions/Services can be modified in Apple's Automator utility. Once an Automator service is installed in the user's Library/Services folder, it will be available in the Finder's Quick Actions menu (or right-click context menu) when PDF files are selected. Most of the scripts are designed be used in the Run Shell Script action of Apple's Automator app, which provides an easy interface for use. These scripts are designed to be used as Automator Quick Actions in the Finder (aka Services) PDF Services (in the PDF button of the Print dialog) or as Terminal commands, with filenames as arguments. This is all done with python scripts that access the Core Graphics Quartz APIs inside MacOS. Author, Creator, Table of Contents) to PDFs Add page numbers, watermarks, tints or other text and graphics to PDFs.Convert PDFs to images and images to PDFs.Everything you could possibly want to do to a PDF is just a click away! Swift is brick slow as a scripting language, compared to python. The repository for the Swift version of these scripts (along with shortcuts for Shortcuts.app) can be found here:īut. Also, the scripts could be compiled or easily refactored for other projects. As Apple's prime development language, it's the safe bet. So, what to do now to offer 'default' scripting to non-technical users?Īpple's Shortcuts.app allows scripts to be run, much as Automator does/did, so the question is: what language to use? Ruby and perl are similarly 'scheduled for removal' by Apple JavaScript and AppleScript are hideous -) - but Shortcuts.app also includes the option to run Swift code as a script. Once you done that, then typing pip3 install pyobjc should be enough to install the necessary library. You will also need to install the pyobjc library. That's what I'm using, and I've updated all the scripts to work with python 3. ![]() Python 2 and the essential pyObjC library can still be downloaded and installed, for the time-being, at least and the 'legacy' versions of the scripts should still run (the initial line may need changing to #!/usr/bin/env python instead of #!/usr/bin/python in some of the Automator workflows).īut if you're going to install python, it should probably be python3. PDFsuite NOTICE: The Retirement of python 2Īpple has finally removed python2 from MacOS with the introduction of Monterey 12.3 thus ending over 15 years of a stable, compatible scripting environment. ![]()
0 Comments
Leave a Reply. |