Skip to content
Solely for the Purpose of Catching $PAMRZ

PocketModMac: MacOSX PocketMod Generator Via Print Dialog


This one goes out to all of the MacOS X users out there. (For the rest of you, why aren’t you switching?) Perhaps you have seen PocketMod — the origami-like manipulation of an 8 1/2″ by 11″ piece of paper into an 8-page booklet.

PocketMod example pictureExample PocketMod, courtesy of the Boston Globe.

Touted as a way to “get back to the basics” using analog media over digital media, it is a scheme by which you can transform pages of text into a pocket-sized form for carrying around. Many use it as a way to synchronize their digital to-do lists with the analog world, while others use it document shortcuts and cheat-sheets in a convenient form.

I’m migrating from Thinking Rock to iGTD as my Getting Things Done tool-of-choice. One of the things I’m missing about Thinking Rock is its built-in ability to create PocketMods for the actions in the GTD system. The only real easy way to create the PocketMod format was via a Flash applet or a Windows application. Some have set up shell scripts or worked with other programs, but I was looking for something as simple as the MacOS X print dialog box. And with a little bit of Automator, Java, and shell scripting, it is possible!

Step 1: Get the “Multivalent” PDF Manipulation Toolkit


The heavy lifting of this solution uses the Multivalent PDF Manipulation Toolkit. This is a Java-based application that perform various actions (impose, compress, uncompress, info, encrypt / decrypt, split and merge, and validate) on PDF documents (as well as other file formats). It is an open source application available under the GPL license (although some components of Multivalent have commercial use restrictions) available from SourceForge at this download URL: Multivalent20060102.jar. Download that file and save it somewhere on your hard drive. You’ll need to know the direct path location for the next step.

Step 2: Create the Automator Action


Launch “Automator” (you’ll find it in the Applications folder). It will start with a new, untitled work document. From the left-most panel, select “Automator”, then from the panel just to the right of that click and drag “Run Shell Script” to the empty document on the right.
Dragging "Run " to empty windows

In the ‘Run Shell Script’ action, change “Pass input” to “as arguments” then replace “cat” in the command box with this (ignoring any line breaks that may appear here — this text should be entered without line breaks):

cat "$1" > /tmp/temp$$.pdf && java -classpath [location]/Multivalent20060102.jar tool.pdf.Impose -dim 2x4 -layout "1l,2r,8l,3r,7l,4r,6l,5r" -paper letter -verbose /tmp/temp$$.pdf 2> /tmp/temp$$.err && open /tmp/temp$$-up.pdf

Replace [location] with the complete file path where you downloaded the Multivalent20060102.jar file. The final results should look something like this:
Completed action

Now save this as “PocketModMac” in either the “/Library/PDF Services” directory (to make it available to all users of your machine) or to “Library/PDF Services” in your home directory for just you.

Step 3: Using PocketModMac


Using this PocketMod generator is as simple as printing any document to any printer. In the print dialog box, pull down the PDF menu and select “PocketModMac”.
Print Dialog

After a few seconds, the Preview application will open up with the PocketMod-ed document. Print this document as you would to any printer, then follow the directions for folding and cutting the page to create your booklet.
Folding Instructions

Troubleshooting and Known Issues


Using Automator to string together a Unix command line like this is moderately fragile and doesn’t provide for a lot of feedback on potential errors. If it doesn’t work for you, one place to look for problems is in the /private/tmp directory for a file called temp[number].err. The contents of that file may give clues as to what went wrong.

This isn’t necessarily a very nice solution because it leaves files laying around in the /private/tmp directory after it is done. The /etc/periodic/daily/500.daily maintenance script will clean them out automatically after three days, but still — it is somewhat sloppy to leave them around.

(This post was updated on 23-Sep-2008.)

3 Comments

  1. ds | August 22, 2007 at 2:31 pm | Permalink

    Great sadness. I was overjoyed to find this, but, alas, can not make it work. I’ve copied your directions scrupiously, but when I choose the print command, the pages progress bar goes by and–nothing happens.

    I’ve searched for the temp[number].err you mention, but I don’t seem to have that.

    Any extra tips?

  2. ZZamboni | September 23, 2008 at 9:06 am | Permalink

    This is very cool, thanks for the instructions! It works fine under Leopard (10.5.5) for me. One note of advice: if you copy-and-paste the script, you have to make sure to replace the funny graphical characters (the x in “2×4″ and the quotes around “1l,2r,etc.”) with their ASCII counterparts, after you paste the text in Automator. Also, don’t forget to change the “Pass input:” setting to “as arguments”! I made both of these mistakes, but after fixing them, it works beautifully.

  3. the Jester | September 23, 2008 at 10:32 am | Permalink

    @ZZamboni — Thanks for trying this out and reporting the issues. The core of the problem is that WordPress’s wptexturize function — invoked by the theme to pretty up the typographical elements of the text — modifies characters within <code> tags. I’m using a <blockquote><code> combination because if I were to use a <pre> block the shell command would stretch well past the right margin of the browser. (And if I artificially insert line breaks inside the <pre> block, those line breaks would be pasted into the Automator window.)

    I found PlanetMike CodeQuotes will reverse the changes made by wptexturize inside <code> blocks. I had to make one addition to the plugin because wptexturize was replacing regex /(\d+)x(\d+)/ with $1&#215;$2. So I added this (which will probably also get munged by the WordPress wptexturize function): $line = str_replace(’×’, ‘x’,$line);

    While tweaking the article, I also modified the “Run Script” automator action graphic to highlight the need to modify the “Pass Input” parameter.

8 Trackbacks

  1. Technology | August 9, 2007 at 3:47 pm | Permalink

    links from Technorati . . . the enormous size of the modern corporation cannot be explained as due to increased efficiency; many specialists regard the size now typical of the giants as already in excess of the requirements of efficiency. … PocketModMac: MacOSX PocketMod Generator Via Print Dialog This one goes out to all of the MacOS X users out there. (For the rest of you, why aren?t you switching?) Perhaps you have seen PocketMod ? the origami-like manipulation of an 8 1/2? by 11? piece of paper into an 8-page booklet.

  2. Kramer auto Pingback[...] DataGazetteer via dltj.org Submitted: Aug 13 / 08:57 PocketModMac: MacOSX PocketMod Generator Via Print Dialog Using the built-in MacOS X “Automator” scripting function plus the Java-based “Multivalent” PDF [...]

  3. macosxhints.com - OS X tips and tricks! | August 20, 2007 at 7:30 am | Permalink

    links from Technorati Full details can be found in this post on the Disruptive Library Technology Jester blog. [robg adds: I tried this, and it seemed to work as described.]

  4. teddythebear: Print2PocketMod in MacOSX | August 29, 2007 at 12:51 pm | Permalink

    Kramer auto Pingback[...] in MacOSX Finally found this via macosxhints.com: a tutorial for PocketModMac, a MacOSX PocketMod generator via print dialog. Now you can print directly from any MacOSX application directly to a PocketMod page.Labels: Mac, [...]

  5. links from TechnoratiPocketModMac: MacOSX PocketMod Generator Via Print Dialog in Disruptive Library Technology Jester

  6. Kramer auto Pingback[...] a convertirlo in un unico foglio pronto per essere ripiegato come PocketMod, una volta stampato.Pocketmod generato via print dialog (MacOS X)Dettagliate istruzioni le trovate nella pagina linkata. Si spiega come aggiungere la [...]

  7. [...] PocketModMac: MacOSX PocketMod Generator Via Print Dialog - A cool way of printing in PocketMod format from any MacOSX application (tags: pocketmod macosx tools productivity printing ) Tags: Linky · macosx · pocketmod · printing · Productivity · tools [...]

  8. Kramer auto Pingback[...] - The harder to set up (not _that_ hard, it took me all of 10 minutes), but automated way: create a new "PocketMod" PDF service and print directly in PocketMod format from the Print dialog. None of these is exclusive for [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *
Human Detection Scheme
(What's this?)
Comment Preview

Subscribe without commenting

From the Disruptive Library Technology Jester (http://dltj.org/), printed on Tuesday the 16th of December 2008 at 4:52:41 PM EST (-0500). The URL to this page is http://dltj.org/article/pocketmodmac/

[Creative Commons Logo] This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/us/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.