iPhone and the Polaroid PoGo Printer

December 12, 2009

I bought a Polaroid PoGo Printer the other day.  It was on sale at “The Shack” for $29.99.  I’d always been intrigued because its little and battery powered.  The printer uses ZINK technology.  Its inkless — the color is embedded in the paper and appears when the printer heats the paper.  More about ZINK can be found here.

The printer connects via USB to Pict-Bridge enabled cameras and via Bluetooth to cameras and PCs.  One thing it does not do, however, is connect to an iPhone!  So I set out to see if I could print to the PoGo printer from my iPhone.

The first way is to copy the picture to a computer and then print from there — but that just isn’t fun enough.  So I decided to see if I could at least automate this process and keep it wireless.

The picture’s path would still be iPhone to computer to printer.  This is the process I used:

1.  Take picture on iPhone
2.  Email picture to myself from iPhone
3.  Use mail’s rules to detect the picture
4.  Have the mail rule run an AppleScript to send the picture to the printer

So — next I had to figure out the AppleScript and the rule.  I find AppleScript not particularly intuitive.  Figuring out how to get the picture from the email and then send it to the printer via Bluetooth was basically a process of Google Search, trial, and error.  In the end, I cobbled it all together.  My solution is fairly fragile.  It barely works, but it does work.

Here’s the AppleScript:

using terms from application "Mail"
 on perform mail action with messages newMessages
 tell application "Mail"
 (* Only process 1 message.  Note: rule ensures the message has at least 1 .jpg
attachment *)
 set firstMessage to item 1 of newMessages
 set theAttachment to first item of the firstMessage's mail attachments
 set theAttachmentPath to ((path to home folder) as text) & "test:"

 -- Make the file name unique-ish by adding a number representing the time to the file
name.  This is because iPhone sends pictures as photo.jpg.  
 set theAttachmentFileName to theAttachmentPath & (time of (current date) as string) &
theAttachment's name
 save theAttachment in theAttachmentFileName
 -- Use Bluetooth File Exchange to send the file to the printer.  I could only make
this work by using the numeric name for the printer.  This is found from getting additional
info about the device from Bluetooth preferences.
 -- You have to pass the file name as a POSIX formatted string.
 tell application "Bluetooth File Exchange"
 send file POSIX path of theAttachmentFileName as string to device "00-04-48-13-95-11"

 end tell (* Bluetooth File Exchange *)

 -- Make sure the file is fully transferred to the printer before deleting it.
 delay 30

 tell application "Finder"
 delete theAttachmentFileName
 end tell (* Finder *)

 end tell (* Mail *)
 end perform mail action with messages
end using terms from

In order to use the script, you need to create a folder on your Mac called “test”.  This folder needs to be at the top level of your user (Macintosh HD:<username>:test).  You can go thru the script and change the name and location of the folder, if you want.  Also, I saved the script into that folder — just to keep everything together.

Next you need to create a rule in Apple’s mail.app.  Here’s the rule I created:

Pogo Print Rule

Note:  You also need to create a mail folder called “temp”.  The messages are stored there.  You can delete them after the image has been printed.

To use the rule and script:

1.  Make sure your printer is paired with your Mac.  Instructions on pairing the Polaroid PoGo printer with a Mac can be found here.
2.  Make sure the printer is fully charged, turned on, and connected to your Mac.
3.  Make sure mail.app is running on your Mac
4.  Take a picture with your iPhone (or you can use one from your photo gallery on the iPhone).
5.  Click on the “share” button when viewing the photo, and choose “Email Photo.”
6.  Send the photo to yourself (the account where you created the rule in mail.app)
7.  Once the photo is sent from your iPhone, and received by your Mac — printing should automatically begin.

My script will only print the first photo attached to an email.  Also, you should not send a second photo until the first one is completely printed.  Things will not work if the printer battery is nearly depleted or the printer doesn’t have any paper.

If anyone has any suggestions on how to improve this process let me know.

Moving Your iPhoto Library

August 23, 2009

Since I’m using a 13″ MacBook as my primary computer these days, I always find myself thinking about when I’m going to fill up the hard drive.  I know that I can always get a bigger one, but that seems like a hassle.  So, I’ve always wondered about moving my iPhoto library to an external hard drive.  Its not super obvious, but it is pretty easy.

First, it helps to understand how iPhoto stores your pictures.  iPhoto uses something that Apple calls a “package.”  This is the same type of thing that used to store applications.  A package is really a folder that looks like a single file.  In face, you can drill down into a package and see its contents.

The iPhoto library is package stored in your home directory/Pictures and is, by default, called “iPhoto Library.”  If you double click on it, iPhoto will open, but if you right-click or “option” click on it, and choose “show package contents,”  a Finder window will open showing the contents of your iPhoto Library.  If you want to move it, you just have to copy (or move) the iPhoto Library package to another drive.  It really is that simple.  You should make sure that iPhoto is not running before you do this, however.

Now, the trick is telling iPhoto to open the library in its new location.  To do this, just hold down the “option” key when you launch iPhoto.  You’ll get a dialog box asking you to choose an iPhoto library.

iPhoto Library File Open Dialog

iPhoto Library File Open Dialog

If you click on the button “Other Library…,” you’ll get a file open dialog box where you can navigate to the location of the library.

iPhoto Choose Library

iPhoto Choose Library

Once you choose the new library, it’ll become the default — so iPhoto will try to open that same library the next time you launch it.  If you want to open a different library, just hold down the “option” key when you launch iPhoto, and you’ll get the option to switch libraries.

Hello world!

June 1, 2007

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!