revised AutoHotKey script

A couple of weeks back, I posted a semi-useful AutoHotKey script, just a little script to paste text from the clipboard, but stripped of formatting. Well, I did some searching, and of course, I’m not the only person to have come up with this basic script. This guy posted a similar script, a couple of years ago. The one thing I learned from his script, which I somehow didn’t think of myself, is that, rather than sending the clipboard contents using “SendInput”, it’s better to put the text back on the clipboard, then send ctrl-V. The reason this works better is that, in most applications, a paste is an atomic operation that’s easily undoable, whereas using SendInput appears to the application as though you just manually typed out the contents of the clipboard.
I also decided to disable the macro in Excel, since I have an existing macro in Excel that’s mapped to ctrl-shift-V, and I don’t want to override that. So, bottom line, the macro now looks like this:

#IfWinNotActive Microsoft Excel 
^+V::
myStr := clipboard
myStr := RegExReplace(myStr, "s+$","")
clipboard := %myStr%
Send ^V

Still nothing terribly amazing, but very useful, and something I was living without for longer that I should have.

useful AutoHotKey script

I’ve been using AutoHotKey for a while now. I’ve got a few macros programmed into it that are pretty much wired into my brain at this point. There’s one thing I’ve been meaning to write for the last year or so, and just never got around to it. Well, I was in the middle of something on Friday, and I just decided that I needed to stop what I was doing, and just figure out how to write this macro. It turned out to be a lot simpler than I though it was going to be! Now I feel kind of stupid for putting it off for so long.

Basically, I wanted a macro that would do a “Paste Special / Text Only”. Mostly, I needed this in Lotus Notes, but there are other apps where it could come in handy. Long ago, I’d taken care of this in Word with a simple one-line VBA macro. But, I never really knew how to do this in Notes. The reason I need this, is that I’m often pasting text from Word, or a web page, or some other app, into Notes. The text goes to the clipboard as formatted text, and if I just do a straight paste into Notes, all the formatting info gets pulled in, and it’s usually not a good match for the default e-mail formatting in Notes. So, I’d settled on just selecting Edit, then Paste Special, then Text from the menus. But that’s a lot more work than pressing Ctrl-V.

Before yesterday, I’d never looked at the AHK docs closely enough to realize how simple this was. The contents of the clipboard, in plain text format (that’s the key there!) are available in a system variable called “clipboard”. So, all I really needed to do is call SendInput on that. Duh. Just to get fancy, I also decided that I wanted to trim trailing whitespace from the clipboard contents. So, here’s a simple macro that trims trailing whitespace from the contents of the clipboard, and sends it out:

^+V::
myStr := clipboard
myStr := RegExReplace(myStr, "s+$","")
SendInput %myStr%

I just have that mapped to Ctrl-Shift-V, so I can paste text anywhere, without formatting, no problem. And, yes, I could have written this in one line, but I broke it up so it would be easier to see what I was doing.

The point of this story, I guess, is that AutoHotKey is a wonderful thing, and that some things are simpler than you think they are, if you just sit down and spend a few minutes reading the docs.

Windows 7 in-place upgrades

Based on this article and this one too, both by Woody Leonhard, it looks like I won’t be able to do an in-place upgrade from Vista Ultimate to Win 7 Pro. I’m running Vista Ultimate on my desktop PC and my Inspiron laptop, and I was actually hoping to do an in-place upgrade on them both. Oh well. I guess if I’m forced to do a wipe & clean install, then that gives me the opportunity to switch from 32-bit to 64-bit too.

I was really hoping I could get away with an in-place upgrade though. It wasn’t that long ago that I did a clean install of Vista on my desktop PC, when I bought a new hard drive. It took a lot of time to get everything re-installed and set up after that. And, on the laptop, I’m a little worried about getting all the Dell drivers installed and working after a clean OS install.

I guess if I have to do it, I’ll figure it out. I’ll probably try 64-bit on the laptop, and see if it works. If it does, that’ll be great. I’ve never had a 64-bit OS on any of my Windows machines at home, so that’ll be something new. My desktop PC has a 64-bit chip too, but it’s an older AMD chip, so I’m a little leery of trying a 64-bit OS on there, without first replacing the motherboard and CPU with something more modern.

Windows 7, and lots of it

I pre-ordered a copy of Windows 7 Home today, to go along with the two copies of Win 7 Pro I pre-ordered a while back. My plan is to install Pro on my desktop machine and my Inspiron laptop, and to use the Home upgrade on either my new Aspire One, or a VM on my Mac. I don’t think I’ve ever bought three copies of an OS upgrade before. I hope it’s worth it!

I listened to a podcast on Windows 7 yesterday that was pretty interesting. If the company I work for was in better shape, I’d love to roll out Win 7 to all our users. I don’t see any way we could afford it though, either financially or in terms of the time commitment. I think we’ll be sticking with WIndows XP for the foreseeable future.

Windows 7

I went ahead and pre-ordered two copies of Windows 7 Professional today. The pre-order deal ($99) is supposedly half the price that they’ll normally charge for an upgrade ($200). Microsoft has been kind of vague about when the pre-order deal expires, so it may be safe to wait until a lot closer to October to order, but it can’t hurt to do it now. I’m pretty sure Amazon won’t charge my credit card until it ships.

My intention is to upgrade both my desktop machine and my laptop to Win 7, soon after the release. They’re both running Vista Ultimate right now. There’s no half-price deal on the Win 7 Ultimate upgrade, so that’s only available for the full price of $220, effectively more than twice the $99 Pro deal. I don’t think there’s enough extra stuff in Ultimate to justify that price, so I’m going to drop back to Pro when I go to 7. It’s all very confusing. I don’t know why Microsoft broke Vista into so many SKU’s, and I don’t know why they’re not simplifying it with 7. (Maybe they are simplifying it a bit, but the whole “Ultimate” thing is still dumb.)

Chandler and Lotus Notes

I had a few spare minutes today, so I installed Chandler on my PC at work. No major problems with the install, or with creating an account on Chandler Hub. I played around with it a bit, and so far, I like it. It’s reasonably fast to load and use. Since it’s a cross-platform app written in Python, I was concerned that it would be slow, and maybe have some user interface quirks. Not that a cross-platform Python app can’t be fast and have a good UI, but a lot of the time, that’s not the case.

The e-mail integration, as I mentioned in my post yesterday, is a little weird. Chandler uses IMAP to create three folders in your mail file, Chandler Events, Chandler Messages, and Chandler Starred. When you drop messages in these folders, they appear in Chandler. That part seemed to work OK with my Lotus Notes mailbox.

Chandler can also send e-mail. That, I thought, would be straightforward. It’s just attaching to an SMTP server. I have plenty of apps that use my Domino server to send SMTP mail, so I didn’t expect any difficulty there. I didn’t have any problems just connecting to the server. However, I’ve found that the e-mails sent from Chandler don’t render correctly in Notes. A bunch of XML, which is probably supposed to be hidden, shows up in the message. I did some testing, and the e-mails from Chandler look fine in GMail, and in Apple’s Mail.app. They look like a mess in Notes though. Oh, and I tried Notes 7, 8, and 8.5 clients, and it’s the same either way. I did find, though, that the e-mails in Notes look fine when I’m accessing my mailbox from my iPod or BlackBerry.

When things go wrong with e-mail rendering in Notes, it can be hard to figure out where things went wrong. First, the Domino server may screw something up before it gets to your mail file. If it’s not that, then it might be something related to your mail file template, or to the Notes client software. Since this problem occurs in Notes 7, 8, and 8.5, I’m guessing it’s not a simple client quirk. It could be something in my mail file template. That’s still on version 7, and I can’t really change that without upgrading my Domino server.

So, bottom line, if I can’t get the outgoing e-mail to look OK in Notes, Chandler is going to be mostly useless for me. If I can get that working, then it’s promising.

Oh, and one other interesting thing about Chandler. There’s a book called “Dreaming in Code” about the initial development process on Chandler. This book is frequently compared to Tracy Kidder’s Soul of a New Machine, which is a great book about the development of a minicomputer back in the 70’s. Chandler’s development process, apparently, was a bit rocky. At the time the book was written, the program had been in development for several years, and hadn’t produced a workable 1.0 release yet. I think that the author’s original intention was to document the development of a revolutionary open source app that would really be a killer app that would compete with Outlook and maybe Lotus Notes. In the end, he wound up with a book documenting a lot of things that could go wrong with a development project, which is maybe an even more interesting book than he would have gotten if the project had gone well. (I haven’t actually read this book yet, so I’m generalizing from the reviews I’ve read. I do want to pick up the book and read it at some point.)

stupid boot camp

So I decided to mess around with Boot Camp tonight, and maybe install Win 7 on my Mac.
First problem: I figure out that Boot Camp Assistant isn’t installed on my Mac. So, I have to get the OS X install DVD, and figure out where the installer is, and run that. OK.
Next problem: When I set up my new 500 GB drive a couple of weeks ago, I used 400 GB for my Mac partition, and left 100 GB for a possible Windows partition. Thinking ahead is good, yes? Apparently, no. Boot Camp Assistant doesn’t recognize that. It cheerfully offers to subdivide my 400 GB partition, so I can use part of *that* for Windows, but it doesn’t even see that 100 GB unpartitioned space.
So, now I’ve re-sized my main partition to take up the whole drive. Maybe tomorrow night I’ll run BCA again and see about breaking it back up into two partitions.

XP no more

I’ve been slowing working on moving over from XP to Vista on my main home desktop machine since August 2008. I finally decided to finish up on that today.

I had been running in a dual-boot config since August, with XP on my old drive, and Vista on a new drive. My goal for today was to switch to a plain old single-boot config, with the Vista drive as drive 0 and the XP drive reformatted, so I can use it for backups, as drive 1. The problem, of course, is that the old XP drive was technically the boot drive. You’d think it wouldn’t be too hard to switch things around so that I could boot from the Vista drive, but it’s actually a bit of a pain. I followed the instructions here, which sounded like they covered my situation perfectly, but that didn’t work, and I wound up having to boot the machine with my Vista install DVD and run a repair. It took awhile to get all the way through this, but I seem to have a working Vista install now, booting off the Vista drive. And I’m reformatting the old XP drive right now.

This all took longer than it should have. Microsoft really didn’t need to make the Vista boot process so darn arcane. But hey, I’m now 100% Vista, just in time for Windows 7 to come out…

syncing

I’ve been using MobileMe to sync contact & calendar data between my MacBook and my iPod Touch for a while now. It works pretty well. Today, I decided to go one more step, and set up MobileMe on my Vista desktop machine to sync with Outlook. The contacts were no problem; they synced up fine the first time through, and I then went through them and weeded out a few duplicates.

The calendar was a little trickier. I have three calendars in MobileMe: Home, Work, and Birthdays. The birthday calendar is populated automatically via MenuCalendarClock, a shareware program that just pulls birthdays from the Mac address book and puts them into iCal. These calendars all now show as separate calendars in Outlook. I had to basically push them down to Outlook, rather than doing a straight merge, though, to get them to show up.

There’s a default calendar in Outlook called “Calendar” that has now synced up the MobileMe (and hence my Mac and iPod). I never used the calendar in Outlook before, so this is just an empty calendar. There doesn’t seem to be any obvious way to delete it in Outlook, or to tell the MobileMe control panel not to sync it up. Not a huge deal, but a little annoyance.

And repeating events seem to be treated a little differently in Outlook vs. iCal. After I pulled stuff into Outlook, then synced back to MobileMe, then synced my Mac, every repeating event on my calendars showed as changed. I’m hoping this is a one-time thing, and I’m not going to have to push & pull every repeating event at every sync.

I’m also a little worried that, when I go to http://www.me.com/calendar/ to check my calendar online, I just see “Loading Events”, and nothing ever comes up. I think when something this has happened in the past, it would generally clear itself up overnight. Here’s hoping. Looking around online, though, this may have something to do with the way Outlook messed with the repeating events. I may have to do some work to straighten this out.

My reason for setting up Outlook with MobileMe, by the way, is because I’m thinking about replacing my old Motorola cell phone with a BlackBerry in the not-too-distant future. If I do that, I’m going to want to do full contact & calendar sync with the BlackBerry, and it seems like the easiest way to do that might be through Outlook. It seems like it’s possible to sync a BlackBerry directly with a Mac, but I figured it couldn’t hurt to set up my PC with all my data either way.

Virtual PC

I finally got around to installing an XP virtual machine under Virtual PC on my VIsta desktop PC. This is one of the last things I need to do before wiping out the XP install on that machine, which I’m currently running in dual-boot mode.

I discovered one odd thing while setting this up. If you install XP with SP1 under VPC on Vista, the VPC additions won’t quite work right until you upgrade the virtual machine to SP2. Just a little hint, in case anyone else runs across this problem.

I’m currently letting the XP VM upgrade itself to SP3 via WIndows Update. Boy, that’s taking a long time!