I was thinking the other day that it'd be nice to be able to print from my Zaurus, but it seems pretty complicated to enable printing in Linux. But then it hit me -- I have a Mac that's on all the time, always connected to a printer and ready to print. Why couldn't I somehow use my existing setup to print from the Zaurus? Obviously, you can manually copy the file you want to print over to your Mac and print it, assuming that it's in a format that the Mac will recognize. But this is a little clumsy and time consuming.
In order to use this method, you have to have some kind of network connection to your Mac. I've used it both with a wi-fi card and with my bluetooth card connected to the Mac (see
this thread for information about setting that up). All you have to do is be able to send files to a certain folder on your Mac. You could use samba, but I use ftp.
You need to make a folder (we'll call it "Print") and attach the following folder action script.
on adding folder items to this_folder after receiving these_items
try
tell application "Finder"
repeat with i from 1 to number of items in these_items
try
set this_item to item i of these_items
set the path_string to this_item as string
set the final_path to POSIX path of the path_string
do shell script "/usr/bin/lp '" & final_path & "'"
on error error_message
tell application "Finder"
display dialog "Error for item " & (this_item as string) ¬
& ": " & error_message buttons {"Continue", "Cancel"} ¬
default button 1 giving up after 120
end tell
end try
end repeat
end tell
on error error_message
tell application "Finder"
display dialog error_message buttons {"Cancel"} ¬
default button 1 giving up after 120
end tell
end try
end adding folder items to
I've attached a premade version of this script if you want to download it.
Just control-click (or right click) on the "Print" folder and assign this script to it. Then every time a new file appears in the folder, even via ftp, it will be printed automatically. It won't work with Word or Excel files, but generic file formats like txt, rtf, and jpg work. Now I can print from the Zaurus wirelessly. It's actually pretty cool.