What these are:

These applications are Perl scripts or Applescripts packaged as Mac OS X applications. Each app is a stand-alone program that does not need to be installed, you can simply run it from a USB drive or its current directory. You do not need to have administrative permission* or any other required programs installed for the scripts to run.

The installer application attempts to write the apps to the Applications folder. This does require administrative permissions. However, the programs themselves should run just fine if you simply copy them off of a USB drive into your Home folder rather than using the installer app. Hide Note


What these do:

The apps are designed to assist in working with PDF files. The PDF Renamer app attempts to rename PDFs based on the article title, while the PDF Unlocker app attempts to remove restrictions on individual PDF files.


How to use these:

Short answer: Drag PDF files onto the program icon. The apps will process them interactively (PDF Renamer) or automatically (PDF Unlocker). That’s it.

Specifics for each program:

  1. PDF Renamer: This app uses AppleScript at its core. Any PDFs processed with the app will be searched for metadata containing either the document title or a DOI. If either of these elements are found, the script will ask you if you’d like to rename the PDF to the title extracted from the metadata, presenting the new name in an editable text area. You can choose to accept the new name, to cancel renaming this specific PDF, or you can modify the suggested name prior to accepting the change. For PDFs containing an identified DOI, the app will attempt to use the DOI lookup service at http://dx.doi.org/ to extract metadata. To perform this task, the app will attempt to ping google.com when opened to determine if network access is available. If connection is successful, PDF metadata will be downloaded to a temporary file in the user's temp directory (~/Library/Caches/TemporaryItems/), the Title attribute will be extracted, and then the temporary file will be deleted. If network access is not detected, the application will not attempt to use DOI data. The full script used to perform this task is embedded in the app. If you don’t trust the app, feel free to block network access for this program, or to examine the script (located at “PDF Renamer.app/Contents/Resources/Scripts/main.scpt”) to be sure you want to allow DOI lookup.

    Troubleshooting: This app uses mdls metadata to identify the Title attribute. (You can see this metadata for yourself by calling “mdls file_to_check.pdf” in Terminal.) Occasionally, this metadata is not found or has not yet been indexed by Spotlight. If no titles are found, running the script on the affected files can trigger indexing of the files. In this case, the script will often work the second time it is run. Repeated DOI lookup errors may occur if the app loses network access or does not have permission to write to your temp directory. If you encounter repeated errors, manually performing a DOI lookup will occasionally fix access issues.

    Why does this program use a cocktail shrimp as an icon? Because I happened to have this icon handy when I built the program. No other reason.

  2. PDF Unlocker: This app uses a Perl script coupled with a command line utility to remove security from PDF files. It will open a small window that will accept dropped PDFs, or folders containing PDF files. While all files dropped onto the app will be examined, only PDF files will be processed. Each PDF is checked for file protection using mdls metadata. (You can see this metadata for yourself by calling “mdls file_to_check.pdf” in Terminal.) If a protected PDF (e.g. “file.pdf”) is found, it is renamed (e.g. “locked_file.pdf”) and an unlocked copy is created (“unlocked_file.pdf”). The original file is left untouched (aside from being renamed). Note that truly secure PDFs (those that require a password to open or view) cannot be changed by this app. All components of this app (including the program icon) were built with freely-available or GPL-licensed components (see Credits, below). Note: The only reason I built this script was to allow me to paste DOI information into attribute field of PDFs that do not allow editing of metadata, so that I could then process the file with PDF Renamer. What you do with the program is up to you.


A note on versions:

While I generally release both 32-bit and 64-bit versions of apps I create or package, these utilities are currently only available for Intel Macs running OS X 10.6 or higher, and have only been tested on OS X 10.8. I have not created or tested these apps on PowerPC Macs. PDF Unlocker is packaged as a 64-bit app, however the underlying script will work if packaged as 32-bit. Changes in AppleScript between versions of OS X might render PDF Renamer unusable on older systems. If you really need a 32-bit version, please ask.


Credits:

The compiled AppleScript underlying the PDF Renamer app is based on a script originally written by Martin Michel. The script was edited by Joshua Nixon to add DOI identification and lookup, and to automatically replace illegal characters in suggested PDF names. The Perl script underlying the PDF Unlocker app was written by Joshua Nixon; file unlocking is handled by the pdfclean utility, part of MuPDF. As MuPDF was released under the GNU General Public License (v3), the PDF Unlocker is also released under this license; full source code and text of this license is included in the installer and can be found in the packaged program at  PDF Unlocker.app/Contents/Resources/ . PDF Renamer was compiled using the AppleScript Editor; PDF Unlocker was packaged using Platypus. Installer script was written by Joshua Nixon and packaged using Platypus. Program icons were created by Joshua Nixon.

Questions/Comments/Bug Reports:

Contact Dr. Nixon (nixon049@umn.edu, DrNixon.net) if you have a question or encounter any issues.