Friday, December 01, 2006

Canon Scanner Toolbox

My new Canon scanner, the LiDE 500F, comes with a utility that listens for the scanner buttons being pressed, and can kick off various activities in response. The defaults are to Copy (scan and print), Email (scan and start your email compose with the scanned file attached), Scan to PDF and Scan and open in an application of your choice.

They are all variations on a theme - scan the file and pass the result to another process. The application is called Canoscan Toolbox, and I got version 4.9.

For email, it comes with Outlook and Outlook Express as options, or just save and manually attach. Or you can define your own email client. However, the dialog for picking your email client is just a explorer "pick file" dialog, so you cannot enter any command line options to tell the client what to expect.

And I use Thunderbird, and if you want to start a compose window with an attachment, you need:

thunderbird.exe -compose attachment="c:\the directory\the file"

- which cannot be done. So we have to resort to a little registry hacking. Remember kids, the registry is a scary place and you destroy your computer if you meddle unwittingly.

First go through the pointless dialog box to tell canoscan where thunderbird is, and set it as the email client.

Thunderbird will appear as the selected option in the dialog bog. Now dig out your registry editor and go here:

HKEY_USERS\[clsid]\Software\Canon\CanoScan Toolbox\4.9\Data\EmailApp

Now your clsid will be different from mine, so it may be simpler to search for "canoscan". It should be the first entry that comes up.

You will find that it contains an entry for each email destination you have defined, numbered starting from zero. Find the Thunderbird one, looking something like this:

D:\Program Files\Internet\thunderbird\thunderbird.exe

So you want to alter this entry so that it passes the correct parameters to Thunderbird. Canoscan will add the file name to the end, and luckily, thinks to enclose it in quotes.

"D:\Program Files\Internet\thunderbird\thunderbird.exe" -compose attachment=

If you want to put a default subject line in, go ahead but make sure it is prior to the attachment parameter:

"D:\Program Files\Internet\thunderbird\thunderbird.exe" -compose subject="This is the default subject",attachment=

I guess they will fix this eventually.

1 comment:

Anonymous said...

Thanks for this! I've got an LIDE25 and was looking for something to use Thunderbird in an idiot-proof way.
A slight improvement (the attachment= bit did not work for me): create a batch file (I called mine thunderscan.bat) and when choosing the email program point it to that batch file instead (note: canoscan will look for .exe files but you can just type in the filename in the browse box).

My batch file looks like this:


cd "c:\SCANS\"
dir *.jpg /o-d /b > newest.lst
set /p latest=< newest.lst

"C:\Program Files\Mozilla Thunderbird\thunderbird.exe" -compose subject="CHANGE THIS SUBJECT: DOUBLE-CHECK CORRECT PICTURE ATTACHED!",attachment="c:\SCANS\%latest%"

Basically this will navigate to where you normally store your scans, determine the latest file (that must be after all the one you just scanned) and name that as the attachment.

Cheers Paul!