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.

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.)

Jira

I picked up Jira and Confluence this week, during Atlassian’s “Stimulus Package” sale — $5 each! A while back, I’d looked at Jira, and several other bug-tracking/project-tracking applications, but I never got around to evaluating any of them. I’ve had a vague sort of a plan to implement Trac eventually, after first converting from CVS to Subversion (which was also a vague kind of plan with no particular timeline on it). I don’t think I could have ever talked my boss into paying $1200 for Jira, which is their cheapest commercial license. The $5 version only covers 5 users, but that’s fine, since I only have two programmers working for me right now anyway.

It looks like Jira can work with either CVS or Subversion. I’m still planning on converting to SVN before I install Jira though. Of course, since we’re a (mostly) Microsoft shop, I should probably look into TFS, but I think that might a bit too expensive for me.

It’s a bit of a balancing act, in a small shop, trying to figure out how much time and money to spend on infrastructure (for lack of a better word) — project tracking, version control, formal testing, and so on. I can’t spend too much time on it, but if I don’t do it at all, things start to fall apart…

FrontPocket review

I just installed FrontPocket on my iPod Touch. I stumbled across this program yesterday while I was working on my MobileMe issue. FrontPocket is an application that gives you (almost) full access to your Backpack account on your Touch (or iPhone). This is something I’ve really been looking for since I got the iPod Touch. I was hoping somebody would get around to coding something like this, and now someone has!

The program uses the Backpack API to access the info in your Backpack account, and pull it down to the iPod over the air. It caches the info locally, so you can still have access to it when you’re not connected to WiFi. I just did some testing, and it doesn’t look like the program automatically sucks down your whole Backpack account; it seems like you only have offline access to stuff that you’ve previously viewed online, and only the version you’ve most recently viewed, not necessarily the current version on the web. And it seems like you can’t add new notes or edit existing ones offline.

While online, you can add notes, edit notes, add journal entries, and add reminders, so you can do pretty much anything you’d want to do. The program does not, though, render Textile or HTML, so you’re just viewing the text of your notes. And URL links are not active links, so you can’t click on them and have them open in Safari or anything like that. (And, of course, the iPod Touch still has no copy & paste functionality, so you can’t just copy & paste an URL out of FrontPocket and into Safari.) Oh, and it doesn’t render photos that you’ve stored in Backpack either.

So, overall, there are a number of limitations to this app that I really wish they could find a way to fix. Some of them are likely related to limitations in the Backpack API. Others could be fixed, though they might be non-trivial. The app’s only on version 1.1, so maybe we’ll see some new stuff added in the next iteration. (I wonder if there’s an open source Textile rendering engine out there somewhere that they could convert for use on the iPod/iPhone and just drop into the app?)

The thing I’d most like to see is a full sync option, where my entire Backpack site would get pulled down to the device. I’d even be OK with having to press a button in the app to initiate the sync, though it would be cool if it could be done automatically in the background.

The app does have calendar functionality, by the way, but I don’t use Backpack calendar, so I can’t say much about that works. I haven’t seen any indication that it integrates with the standard device calendar app, though I wouldn’t expect it to; Apple probably hasn’t made it easy for third-party apps to update the built-in ones.

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.

Dazzle Video Creator Platinum

I recently pickep up a Dazzle Video Creator Platinum from Woot. My idea was that I’d take the last few videotapes I own, convert them to MPEG-4, then toss the tapes and the VCR. I had a bit of an adventure getting the software installed and working under Vista. This blog entry helped out a bit. It would be nice if Pinnacle would just allow you to download the full install for their Vista-compatible software, but instead you have to stumble through the install of the XP version, then run a patch install. Once you’ve got that done, and you’ve got the Vista driver for the device installed, it works fine. I’m in the middle of converting an old anime VHS tape to MPEG-4 right now. I’m hoping it’ll be watchable on my Apple TV when I’m done with it. If it all works out OK, I have a few other random tapes to convert, then I’m done with VHS forever.

defunct tech magazines

Related to my post about PC Mag yesterday, here’s an article about defunct tech magazines. I have fond memories of a few of the magazines on his list — Byte, in particular. That was a great tech magazine. Looking through the comments after the article, I see mention of Amiga World, which was another great magazine, about a great computer. On a somewhat related topic, the NY Times just started a new gadget blog.

random patching

I spent a bunch of time on Friday night bringing my various home machines up-to-date with patches and software updates. The impetus for that was largely this security hole in Windows, which seems to be the biggest vulnerability that’s cropped up with Windows in quite a while.

I was also interested in updating my VMWare Fusion install to 2.0. Ars Technica has a good review of Fusion 2 up on their site. I did the upgrade, and it was pretty smooth, but I haven’t had time to play around with it enough to tell if it will work any better on my old MacBook than the previous version.

I realized that I hadn’t turned my Dell Vista laptop on in about a month, so there were plenty of patches and updates to run on that. And I hadn’t started the virtual machine I have set up under Fusion in a while either, so there were a bunch of patches to install on that too.

On Saturday, I remotely applied a whole bunch of patches to our servers at work. The main goal was to get that Windows patch on all the servers, but I also had a bunch of other patching to do. I’m embarrassed to say that I’d never updated our main SQL 2005 server to SP2. That had been on my to-do list for about a year. And I had to apply a cumulative post-SP2 patch file to our HR/payroll SQL server, since our HR/payroll software vendor requires that I bring the server up to that level before I can apply their year-end update. It took about three hours to get all that done. Happily, nothing locked up at any point, so I didn’t have to drive into the office just to power cycle a server. (And, yes, I know there are devices that would allow me to power cycle a machine remotely. But we can’t buy any new equipment right now.)

I have one Windows 2000 server that’s hanging up on one of the updates. I’ll probably have to bring that one up to date in safe mode or something. I really don’t know what’s wrong with it, and I’d like to just get everything off it and moved to a WIndows 2003 machine, but I don’t have the time right now.

I got some interesting errors on the two machines to which I applied SQL updates. There’s a long thread on this problem here, at the Microsoft forum site. I haven’t figured out if this error is actually going to be a problem or not. There’s certainly a lot of confusing (and sometimes conflicting) advice out there on it.

I’ve been watching the Jets game today, and enjoying the newest Mac vs PC ads that Apple’s been airing. The theme is basically how Microsoft is spending a bunch of money on advertising instead of fixing Vista. I have to say that I agree with that. This new security hole apparently exists in every version of Windows from Win 2000 to Vista and Win 2008 Server. There’s an interesting blog entry about MS08-067 and the SDL, covering the failure of the SDL (Security Development Lifecycle) to catch this bug. To quote from the article: “I’ll be blunt; our fuzz tests did not catch this and they should have.” I can’t help but think that a little bit of that Seinfeld cash might have caught this one earlier. I’m probably over-simplifying. These things are really complex, and a lot of stuff can go wrong that no pile of cash can fix.

Meanwhile, I’m looking forward to the Giants game this afternoon. It should be a good one. Well, this was a really long (and probably boring) blog entry, but I haven’t written anything in a few weeks, so I was due for a long one. I’ve got a bunch more random thoughts in my head, but I’m going to resist the temptation to make this entry any longer!

text editors

There’s a poll on Lifehacker about text editors. Their top six are Notepad++, Emacs, UltraEdit, TextMate, Vim, and TextPad. I do use TextMate on my Mac, so I agree with that call. It’s a nice editor. I *wish* I was proficient with Emacs, just because it would probably come in handy occasionally, and just generally seems like something I should know. I’m amazed that people still use vi/vim. I had to use vi a bit back in college, and never liked it. Under Windows, I have to admit that I’m still using Multi-Edit, which doesn’t seem to be a popular choice these days. I’ve been using Multi-Edit 9, which dates back to 1999. I kept putting off upgrades, since ME 9 did everything I really needed to do. At some point, I realized that I needed an editor with Unicode support, so I installed PSPad. I like PSPad, but not enough to switch over from Multi-Edit, except for those occasional Unicode files.

After poking around on the internet a bit today, I decided to finally upgrade to the most current version of Multi-Edit. It seems like ME is still behind the times a bit. The current version is called “Multi-Edit 2006”, and the most recent revision was posted in October 2007. It mostly works in Vista, but there are a couple of problems, mostly with macro recording, from what I can tell by looking at their support forums. And they’ve got some support for Unicode now, but it doesn’t look like it’s really full support.

I’m not sure if sticking with Multi-Edit is the right choice in the long run. UltraEdit might be a better choice; they seem to have been updating their product a bit more regularly. They appear to have full Unicode support and Vista compatibility.

Only a true geek could spend so much time worrying about text editors!