Main

December 09, 2007

Always - on Print Preview

Some software is, in my experience, not quite WYSIWYG when it comes to the final printed output so I have gotten into the habit of viewing a PDF in preview before I actually send a document to my printer. This has saved many trees.

Apple makes it fairly easy to do this. Just command-P and click on the weird-looking PDF button to get the drop down menu to select "Open PDF In Preview."

preview.jpg

I would like to see most every print job automatically open in preview without needing to take my hands off of the keyboard. One can make this happen with a little bit of effort, some help from Folder Actions, and a little piece of free third-party software. Here's how I do it.

First, download and install Cups PDF per the instructions on its home page. This will create a printer and driver that dumps a pdf file into ~/Desktop/cups-pdf/. Set your default printer to CUPS-PDF.

Next, you will setup a folder action on the ~/Desktop/cups-pdf/ to open each file that gets dumped in there in preview. I keep my folder actions scripts in ~/Desktop/Folder\ Actions/, so I put the following applescript (derived from a similar script that ships with Leopard) there.

  
(*
add - new item alert

This Folder Action handler is triggered whenever items are added to the attached folder.
The script will display an alert containing the number of items added and offering the user
the option to reveal the added items in Finder.

Copyright © 2002–2007 Apple Inc.

You may incorporate this Apple sample code into your program(s) without
restriction. This Apple sample code has been provided "AS IS" and the
responsibility for its operation is yours. You are not permitted to
redistribute this Apple sample code as "Apple sample code" after having
made changes. If you're going to redistribute the code, we require
that you make it clear that the code was descended from Apple sample
code, but that you've made changes.
*)

property dialog_timeout : 5 -- set the amount of time before dialogs auto-answer.

on adding folder items to this_folder after receiving added_items
try
tell application "Finder"
--get the name of the folder
set the folder_name to the name of this_folder
end tell

-- find out how many new items have been placed in the folder
set the item_count to the number of items in the added_items
--create the alert string
set alert_message to ("Folder Actions Alert:" & return & return) as Unicode text
if the item_count is greater than 1 then
set alert_message to alert_message & (the item_count as text) & " new items have "
else
set alert_message to alert_message & "One new item has "
end if
set alert_message to alert_message & "been placed in folder " & «data utxt201C» & the folder_name & «data utxt201D» & "."
set the alert_message to (the alert_message & return & return & "Would you like to view the added items?")

display dialog the alert_message buttons {"Yes", "No"} default button 1 with icon 1 giving up after dialog_timeout
set the user_choice to the button returned of the result

if user_choice is "Yes" then
tell application "Preview"
--fire it up
activate
--open the items
open the added_items
end tell
end if
end try
end adding folder items to

Ctrl (or right) click the cups-pdf folder, Enable Folder Actions, then Configure Folder Actions via the contextual menues seen below.


EnableFolderActions.jpg

When you select "Configure Folder Actions" you'll set the script that runs every time a new file is added to that folder to the one above.

folderActions.jpg


Now every time you hit command - P to print in a application, you'll hit enter to print to your default CUPS-PDF printer, which will write a PDF to the cups-pdf folder on your desktop. The folder action will then pop-up this window (for five seconds).

PreviewMe.jpg


All you have to do is hit enter.

So! Every time I print I hit command - P, enter, wait a sec, enter. Instant preview.

September 28, 2007

whaaa?

I've spent 2007 thinking it's 2008.

October 12, 2006

Geek wants his information!

runinfo.jpg

Apparently, when I'm a-runnin (er was runnin' back before I messed up mah hip), I like to know what's happenin...
and I pause a lot. It's because I'm a wimp. ok?

Little Icons:
? = Ask the nike+ for progress (how far, how fast)
! = Played the "powersong"
|| = pause workout (sometimes for stretching, mostly for going "can't breathe")

September 04, 2006

(Badass-mother-turtle) Feng shui

My little turtle friend has a big (compared to him) rock that he likes to sort of hide beneath. Unfortunately, the overhang the rock provides scares me; I fear he may oneday get himself stuck under there. So... I thought it might be a good idea to put some smaller, more rounded, rocks around the overhang of the big rock. Apparently "it's for your own good" isn't much of an explanation for a turtle. His unceasing (and somewhat noisy) project for the last several days has been a major "I want to hide under there" rock rearrangement. He takes breaks to eat, sleep, and occasionally stretch out under the UV lamp. Even as I write this he's treading water looking at me with a that's right, I'm a badass mother-turtle face. He deserves the moniker. Some of those rocks are almost as big as he is.

May 19, 2006

It's not in a box. anymore...

My family used to have a little joke we developed along with our habit of moving every few years. Every time we couldn't find something the answer was "it's in a box." I've been living here for a while, but something about my visit to the container store (a GREAT retail experience, by the way... better than the apple store) to buy a few of their exclusive-to-the-container-store white sterilite storage containers has cause an organize my house meltdown. Of course I ended up having a bunch of other organization tools delivered, thinking I would eventually start throwing stuff out to reorganize what had become a stack of white file-archiving boxes from Staples.

feng shui attack! (Yes, Jenny, I still have my Nintendo).

So here I am, happily scarfing a pop tart (you can get those delivered here in New York) looking out over the vast, comparitively desolate landscape that is my little home. I've spent the last four hours, already exhausted from a busy day, opening every box I had stored in closets and tossing old junk. I had no idea the extent to which I am a pack rat. I found the packaging for every piece of technology I have bought in the last three years, most of the corresponding techno-geekery, two years worth of magazines, too many random "to do" lists from grad school, and even the recovery disks for my very first laptop. (Toshiba Satellite, ca. 1997, P133, 32MB of RAM baby!)

And believe it or not my new macbook is resting on my bed. Earlier than expected. Unopened. Taunting me. I think it's too cool to come out until my home represents the proper environment for a computer that wears a tuxedo. My cluttered desk was ok for anodized aluminum, a RISC processor, and 1024x768 pixels. But this is flat-black (stay away from me with that spraypaint, Dad), *INTEL* (I don't need no reduced instruction set), and wide screen.

Now it's time to continue the tradition of taking a screwdriver or putty knife to my new computer before I even turn it on... time to add 2 GB of ram.

((Incoherence and probable misspellings not intentional, but I can't keep my eyes open. Now, where's my screwdriver set? I'm not going to be able to find anything for weeeeeks))

April 08, 2006

More coffee physics... or don't knock it 'til you try it.

You know you're a caffeine fiend when you make your morning oatmeal with hot coffee instead of water or milk.