Saturday, January 05, 2008

Windows Live Writer cursed by Google's bugs

You know you're in a new era when Microsoft is the humble good guy doing the noble thing, and Google is the arrogant foe of justice.

Google's hacked-together Blogger-Picasa pseudo-integration breaks when image-containing posts authored using Windows Live Writer are migrated to a personalized domain or to an ftp site.

The honorable WLW team has put together a partial solution, but really this is Google's bug.

I'm a longtime user of both Blogger and Picasa. Google is not wasting any of their billions on funding those products. I'd guess it's some manifestation of old-style revenue-funding business discipline. Personally, I'd prefer Google sell both properties to someone who's willing to fund them. I'm more than willing to pay for value delivered; Google's low-cost B-team funding approach is really annoying.

Thursday, January 03, 2008

Wednesday, January 02, 2008

AppleScript - summarize email is useful

I have a library of AppleScript books, but I've never done much with it -- in part because I always thought it was one step away from extinction. It's also a really lousy programming language (scoping anyone?).

Well, whatever its past status it's still with us, and Apple has even fixed up their once decrepit AppleScript: AppleScript Examples page. Automator and AppleScript have been revised in 10.5, the documentation finally left the 20th century, and Python hasn't taken over completely ... yet (alas).

Even in 10.4 I'm rediscovering useful things. Take, for example, the little known "Summarize Message" script buried away in the Mail Scripts folder. Here's what it does:
... This script demonstrates how to write a script that can be executed
directly from the Scripts menu in Mail. It acts on the selected messages,
which are passed in to the 'perform mail action with messages' handler.

This script will take the selected message, create a summary using the
summarize command built into the Standard Additions, then speak the
summary using the say command, also built into Standard Additions...
My mother's vision is failing. This is something she could use, though I've already programme done key to active the built-in generic reading engine. Too bad Mail.app doesn't let me attach a script to a nice fat icon, but I might create a rule that would routinely read each message she opens. (Rules are hidden away in mail preferences -- which is not a logical place for that function.)

By the way, my favorite 10.4 voice is "Vicki". I hear 10.5 has even better voices.

Update: After a bit of experimenting I created an Application from Summarize Email. I then gave it a nice icon from the Icon Factory and put it in the Dock. So it's easy to click on whenever my mother is reviewing her email.

Merging PDFs with OS X Automator

I'm an Adobe Acrobat guru -- too bad it's such a poor quality product. Bad as Acrobat is in XP, it's worse in OS X. Among other things, Adobe can't figure out the concept of a non-admin user.

So I stick with OS X Preview and built in OS X PDF tools. The main thing I miss is the ability to merge and split PDFs.

There are a few OS X utilities to do merges (and more), but it turns out Automator will do the trick (macosxhints.com).

See the macosxhints writeup for the full story. I saved my script as a Finder Plug-In (stored in \Library\Workflows\Applications\Finder), so now I can select any set of PDFs, choose Merge PDF, and they're assembled into a single (oddly named) file on my desktop. The script appends in alphabetic order, so I use a numeric prefix if I want a particular order.

This is the first Automator script I've tried that's really useful!

This is what my script looks like:
!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">


AMApplicationBuild
88.2
AMApplicationVersion
1.0.5
AMDocumentVersion
1
Owning Application
/System/Library/CoreServices/Finder.app
Ok, so that's not very useful. Here's the outline:
  1. Get Specified Finder Items (don't have any values there when you save the script)
  2. Sort Finder Items
  3. Combine PDF pages
  4. Move Finder Items
  5. Open Finder Items
Note that if you omit the Move step the files are saved in an occult (invisible) tmp folder.

Removing embedded carriage returns from Microsoft Access

Carriage return. Such a wonderfully archaic term for the hidden byte that ends a line of text. My children have no idea what kind of carriage can return.

Speaking of archaic, applications like Microsoft Access have trouble with carriage returns. They can't easily be inserted into a text field, but ODBC imports from more sophisticated applications, such as FileMaker Pro, can insert carriage returns into Access fields.

Problem is, there's no easy way to remove them. Fields with embedded CRs behave oddly when edited, and exports and queries break. Search and replace won't work.

I found a method that works.

Export the key column and the troublesome field as XML (no XSD). Then use a text editor to replace every carriage return with a space. The result is a single line, but this doesn't affect XML import. Reimport the XML and the carriage returns are gone.

There are probably better methods.

Update 1/2/07: I ran into another issue where an Access field appeared empty, but it was not NULL. I used 'not null' and 'len=0' to identify these fields, then set them to NULL. Probably another character set problem. I have finally liked all the problems with creating a database that works with Outlook 2003, the PalmOS, sync to Palm, and FileMaker (via ODBC). More on that after I get some sleep.