3 Comments »

In my last post, I discussed how you can use AutoHotkey and SlickRun to quickly display useful text information. Although I’ve been using that technique for months to show me my credit card number, and often-called phone numbers, I recently decided that I wanted to do more. Specifically, I wanted to be able to quickly see a yearly calendar. You know, you’re thinking about something, and suddenly need to know exactly what day the 5th of October is?

My normal technique is to simply minimize everything on my desktop (Win + M key) to see my desktop background. That’s because I’ve got tiny calendars of the next three months sitting there, courtesy of Samurize (see my posts on my desktop for more details). But, really, that’s a pain to do. So I said to myself, why not a popup box with a calendar? And heck, go big, show the whole year at once!

So, using the Cygwin “cal” command, I created a text file, called year.txt, that contains the 2007 year in text. I’m including it here, in case you want to use it, but don’t have Cygwin installed.

Then, using the technique discussed previously, I set up an AutoHotkey script to read the file, and a SlickRun magic word to launch it with a couple of key strokes.

Unfortunately, when I use a message box with calendar information, the default proportional font looks absolutely awful. Unreadable really.

Changing Windows Default Font for Message Boxes

So, I decided to try switching the Windows default font for text boxes. You can get to this from the Control Panel’s “Display Properties”. Go to the Appearance tab, and then select the “Advanced” button. You want to change the Font value for the “Message Box” Item. I’m a big fan of Bitstream Vera Sans Mono. Here’s what your dialog would look like. You can pick any fixed-font for the font. Even if you’ve never installed any extra fonts on your machine, you could use Courier New.

Click OK, and then Apply on the Display Properties window. Now, all message boxes will use this fixed font. I figured that for how often I see a message box, it wouldn’t bug me too much to see a fixed-width font there.

Look at How Pretty It Is

Here is what my yearly calendar looks like now, using the Bitstream Vera Sans Mono font:

Isn’t that pretty? What a clever little solution I found. How easy was that?

Ugly Side Effect

Was I ever surprised when I looked at my FireFox next! Most of the fonts in the FireFox application seem to be based on the same font that the Windows message boxes use. Not the guts of a web page, but things like the address bar, search bar, bookmarks bar, tabs, and status bar. It looked bizarre, to say the least.

Here’s what FireFox used to look like:

And now here’s what it looks like:

I didn’t mind so much on the status bar, but I found the effect really distracting on the tabs, and even in the Extensions list.

Fixing FireFox Fonts

Given how much customization people do with their FireFoxes, I figured there had to be a way to fix this. And there is. You do have to modify your userChrome.css file, which actually isn’t as scary as it sounds.

One of the best sites I found discussing the userChrome.css file was here. The author tells you how to find the file if it already exists (and it might, if you’ve done some other customizations), or how to create it with a text editor. He’s also got several things to stick in there to make other changes to your FireFox.

However, I just used that page to make sure I was editing my file properly. The change that you want to make, to “undo” the font problems caused by changing the Windows default font for message boxes, is as follows:

You want to add the following code to your userChrome.css file:

/* Set font size and family for dialogs
* and other miscellaneous text
* http://www.mozilla.org/unix/customizing.html#usercss
*/

window, tooltip {
font-family: ‘Microsoft Sans Serif’ !important
}

I got the idea from the Mozilla.org Customizing Mozilla page. The example they have their changes the font of everything to Helvetica, with a size of 3.5. I didn’t want that (although you might); I just wanted to change it back to the default font, which is ‘Microsoft Sans Serif’. (Don’t forget the single quotes!)

So, add that little snippet to your userChrome.css file. Save the file. Close FF and reopen it. Now, your FireFox should look right, and you can still have nicely fixed font message boxes.

The example from the Mozilla page didn’t completely fix FireFox though - tooltips were still showing with the fixed font.

So, based on an example from here, I added in the “tooltip” to the code above. That fixed the tooltips, and “window” seems to take care of the rest. There’s probably something else I’ll need to fix, but I’ll just have to keep plugging away at it :)

Update [6 Aug 07]: Instead of using a fancy font like Bitstream Vera Sans Mono, you might be better off using one of the standard fonts that come with Windows, like Courier New. Although I love the look of the Bitstream Vera Sans Mono, I noticed that I was having trouble with other applications. For instance, my SnagIt window couldn’t show some of its menu choices. No idea why, but switching to Courier New fixed that. There may be other things that look hinky. Personally, I’m willing to take a bit of hinky to get the year calendar available with a couple of keystrokes. Your mileage may vary :)

4 Comments »

Do you ever wish there was a way to quickly see some information, without having to navigate to some other application? I’ve found that there are several types of information that I want at my fingertips over and over again. Things like my credit card number, or a list of frequently called phone numbers.

If you’re already using AutoHotkey, you can easily get it to spit out a message box for you, with the requisite information. And, if you’re using SlickRun, or some other quick launching application, you can do it with a couple of key strokes.

Example Message Box (Little Info)

Let’s say you want quick access to your credit card number. Here’s an AutoHotkey script that you can use to spit it back at you:

msgbox, 32, Credit Card, Number: 1234 5678 9012 3456

Simply copy that text and stick it into a text editor. Name the file CreditCard.ahk. Now, when you double-click on that ahk file, you’ll see a message box like this:

If you wanted to, you could stick a whole bunch of info in the one msgbox line. You can use `n (that’s the left single quote followed by n) to indicate where you want a carriage return.

Example Message Box (Big Info)

Alternatively, maybe you want to output a bit more information, and don’t want to have to mess with using `n to indicate carriage returns. It’s also possible to get AutoHotkey to read a text file, and output its contents as a message box.

Let’s take a little text file (say, phone.txt) with a few phone numbers in it:

Doctor (123) 456-7890
Hairdresser (345) 234-2324
Fabio (123) 343-2343

Now, this script:

FileRead, lines, f:\todo\bin\testphone.txt
msgbox, Phone Numbers, %lines%

which you could save as PhoneNumbers.ahk, will read in the phone.txt file and output the contents like this:

Adding SlickRun Goodness

Okay, so far we have great output, but we still have to find the ahk files in the first place, in order to run them. Here’s where SlickRun comes in. (Or whatever other fast launching application you like). Simply create a magic word in SlickRun that runs the ahk file. For instance:

So now, when I want to get my phone numbers fast, I just type the key combination that brings up my SlickRun, then start typing “phonenumbers”. After a few letters, it’s the only option, so I hit enter. Then, up comes my message box with the desired information.

6 Comments »

A couple of weeks ago, I discussed My Super-Duper Personalized Productivity Desktop Background, made possibly by Samurize (see my intro to Sam here).

Today, let me introduce you to my stack. For those of you in the computer science field, yes, I mean that kind of stack. For those of you in the business world, I mean my LIFO system. For those of you who still don’t know what I’m talking about, it’s Last In First Out.

Why a Stack?

There are many ways of looking at lists. Some people make a To Do list, and work their way through it, top to bottom. (That would be a queue, or FIFO ;)). Some people write things on sticky notes, one per note, and do whatever grabs them first. Some people (say, the Getting Things Done crowd) write things on lists, but segregate, organize, manipulate, etc. those lists, e.g., divide your next actions by physical context. Even when looking at a context list, you can still sort through the items, deciding what NA you have the time and energy for.

I want to tell you about a simple tool that I’ve found indispensable lately. I’m not talking about next actions, but something at an even more lower-level, if such a thing is possible. Let’s say that I’m writing a report. I’m going to be working on it solidly for a few hours, and if little things come up, I’m not going to actually create a next action. Instead, I’m just going to scribble it down and fix it later. The little things that I’m talking about are things like “Fix format of heading x”, “Double check spelling of Author x’s last name”, “center picture on page 5″, etc. etc. These are things that I can just collect on a scrap of paper. Things that I don’t want to forget, and I’m going to do in this session, but I don’t want to do *right now* because I’m actually in the middle of my writing flow. We all know what that flow feels like, eh? You don’t want to mess with it by changing mental gears and fixing something.

When writing a report, a stack is not necessary - kind of silly actually. Just collect these notes in a list, or on stickies or whatever, and get them done, in whatever order at the end.

So, Again, Why a Stack?

Now, let’s switch gears. Instead of writing a report, where it’s very important for me to get all the stuff out of my head onto paper, with as few interruptions as possible, I’m now actually going to do some programming. Other processes can fit into this mindset - modelling software, designing anything, physically building, car mechanics, whatever.

The key to the kind of workflow that I’m talking about here is that while you’re working away, something comes up that directly impinges on your work, and *has* to be done before you can do anything else. I find this most often in programming. For example, let’s say I’m coding the implementation of one particular part of the program. It calls on something from somewhere else. Sometimes I can guess exactly what the call will look like, sometimes I want to head to that other place and make that code work first. Sometimes it’s more drastic, especially when debugging. I code something, it doesn’t work. I try to find the error. Trying to fix that error leads me to another part of the code, where I need to fix something else, which leads me somewhere else, etc. etc. It’s a little like walking through a maze. Actually, it’s exactly like that, except I want to be able to come back to exactly where I am to finish things off.

Because I can only keep so many things in my head, I found that I needed a way of keeping track of what I was working on, and every detour I was making, just so that I could find my way back to the starting point again. Enter the stack.

The Stack

All the stack is, is a list where new things get written at the top. I’ve got it set up as a text file. When it looks like I’m going to get diverted from what I’m currently working on, I write a line saying where I am and what my goal is. Then I write a line (above that one) that tells me what I need to fix. When I get there, and find somewhere new to go, I add another line (at the top). When I get to the end of the line, I can work my way back to my starting point by looking at the top of the list, making sure that item is well and truly done, and deleting it. Look at the next item, etc.

Pretty Stack

Of course, I can’t just use a simple text file. I have to automate it. And display it. And massage it. So here’s what I have in my little stack system:

  • stack.txt - just a plain text file. I’ve put a line in it “=====Bottom=====” so that I’ll know when I hit the bottom and have nothing left to backtrack to.
  • push.pl - a little Perl script to insert some text at the beginning of the file. There’s got to be an easier way to do this, but my script does the following:
  • get today’s date and time
  • open my stack.txt and read everything into an array
  • open my stack.txt again, this time for writing
  • write the date/time, plus whatever text I’ve passed in - this becomes the first line, i.e., the one that I’m going to deal with next
  • write everything else back to the file
  • a SlickRun command for push. So all I have to do is trigger my SlickRun and enter something like “push Testing - this is where I am”.
  • pop.pl - another little Perl script to grab the first line from the file. It does this by:
    • open the stack.txt file and read everything into an array
    • grab the first line
    • delete the first line
    • open the stack.txt file again, for writing
    • write the rest of the lines to the stack
  • a SlickRun command for pop. This is a more challenging command; it uses the @MULTI@ command to do two things for me:
    • first, it runs the pop SlickRun command for me, which calls the pop.pl script, which removes the first line
    • then, it runs the peek SlickRun command (described below)
  • peek.ahk - an AutoHotkey script, and this is my favourite. All this little gem does is remind me what I’m supposed to do next. I find this useful because when I’m working, I don’t see my desktop. Sometimes I just want a reminder of what’s on the top of the stack. This script reads the first line from the stack.txt and file and gives it back to me in a popup box - so I can get an in-my-face reminder of what I need to be working on right now, without having to break my train of thought and open the file.
  • a SlickRun command for peek. It just calls on the peek.ahk script.
  • Screenshots

    Here are a couple of images of what this all looks like. First, here’s me putting something onto the stack:


    And here’s what the stack could look like after I’ve started down the long winding path:

    Note: there’s not really any reason it has to be displayed on my desktop; but I like to keep it there as a reminder, for when I stop programming for the day. Then, I can look at the whole stack and get a picture of where I am.

    And here’s what a peek operation looks like:


    When I pop something from the stack, the first line is deleted, and then a pop is done; that’s to tell me what I have to work on next, since I’m finished the current thing I’m on.

    Because I leave one line in the stack to signify the bottom, when I’ve run out things to pop of the stack, the last message box shows me:


    Now I know that I’m back to where I started and I can continue with my primary task.

    Conclusion

    In writing this up, I feel that it sounds much more complicated than it really is. The take-away point is that sometimes when you’re working, you’re in a flow that lets you make note of new things to do, and then ignore them until later. But sometimes, you have to fix something else before you can finish what you’re working on. In the latter case, the concept of a stack or FIFO list can help you track where you’re going, and more importantly, how to get back to where you were when you first got diverted.

    It’s this concept that’s important, not the tools you use to handle it. This is one of the reasons I’m telling you about my system, but not uploading the files (although interested parties can receive them if they wish). You can accomplish the exact same effect with a piece of paper - it’s just the order in which you write things down and cross things off that’s important.

    1 Comment »

    One of my favourite older posts is called Ubiquitous Capture Tool at Your Fingertips - Tweaking for my Taste; in it, I describe how to use SlickRun to add bits of text to a scratch.txt file. There were some comments on that post about how to do this, while putting a blank line between each line of text.

    I thought the solution was to use SlickRun’s @MULTI@ command; but that doesn’t actually work. Because one of the commands that you would be combining with the @MULTI@ takes a parameter, everything falls apart. So, busy girl that I am, I spent some time this morning trying to figure out how to beat SlickRun into submission.

    The result - a new “.” command for putting text into the scratch.txt file. This command is basically the same as my old one, described in the older post, but it has an extra bit of goodness to push a blank line into the file afterwards.

    Result

    You end up with a text file that looks more like this:

    07 Dec 06 9:52 - This is a line, which will be followed by a blank.

    07 Dec 06 9:52 - Now, when I put this line in, I should see a blank above.

    MagicWord

    MagicWord: . <== or whatever name you like Filename: cmd
    StartupPath: directory holding your scratch.txt file
    Parameters: /c echo %date:~4% %time:~0,5% - $i$ >>scratch.txt & echo. >> scratch.txt

    In the previous post, I explain what each most of the parameter line does. Here, I’ve just added a second command using the & command (from DOS). It was a guess on my part - you can use this command at the command line in DOS to string commands together. I just tried it here on a lark. But it works. Anyway, the & separates the two commands, the first being the original . command, putting the current date/time plus whatever you typed into the text file. The second command just echoes a blank line (yeah, “echo.” means blank line) into the scratch file. Don’t forget to use two angle brackets >>, which mean append, not one angle bracket >, which means overwrite.

    Categories: , ,

    5 Comments »

    Update: I absolutely hate working with Windows Live Writer and Blogger Beta. Why can’t they play nice together. Tonight, my lovely post with all its screen shots refused to post. So, I sent the text to Blogger, and then saved all the clips as actual images, then uploaded them. Only to be told that FireFox was crashing, thank you very much. So, I tried again. Siiiiigh. So, if you get this post twice, my apologies. And, whenever you get two posts at around the same time, it’s technology’s fault. ;)

    Yeah, I could have just called this post “Shortcuts to Folders”, but it didn’t sound as punchy.

    There’s a post on the 43 Folders board (which I just started looking at again) asking for

    an app (or a built-in Windows XP shortcut) that allows me to quickly save to or open favorite folders within different applications

    A couple of the suggestions included:

    1. ActiveWords - where it seems you can assign an activeword to a folder. Type in the active word, and the folder will open.
    2. SlickRun - freer version of ActiveWords, and a big favourite of mine. I don’t often use it to open folders, but that skill is most definitely within it’s capabilities.
    3. TweakUI PowerToy - where you can customize the start places folders that show up in many Windows applications dialog boxes.

    I found both the question and set of answers interesting, especially since I didn’t think that the responses really answered the original question. In my head, I had an image of the save dialog box from say, Word. I didn’t think that either ActiveWords or SlickRun would cut it, since you would be using a magic word to open a specific folder in a brand new explorer window, not navigating to it in an existing window. The TweakUI suggestion was valid, but I thought maybe limited as to how many places you could add.

    Then, out of the blue, I got an email from someone with almost exactly the same question:

    I’m trying to find some way to save documents to particular folders in several applications (Word, Excel, Stata, etc.). How would I do this? If I need a different magic word for each app, that’s totally fine.

    Now, the names of the original poster and the emailer are not the same, but the questions are eerily similar? Coincidence? I think not. Anyway, the personal email to me - yay, I love it when people flatter me, triggered me to craft a response. But not just any response - no - this is a complex question, requiring its own post.

    I’m going to look at three different solutions: SlickRun, mentioned above. TweakUI, also mentioned above. And my personal favourite for this kind of thing: AutoHotkey. The solution you choose depends on your requirements. Hmmmm, this sounds like a summary table in the making:

    *When I’m discussing these applications, I’m assuming that they’re already installed. They’re not hard to install, just beyond the scope of this particular discussion.

    SlickRun

    SlickRun is an awesome little program that I use all the time. You create a magic word, say to call a batch file, type in that word in the SlickRun box, and the batch file is executed. Create a magic word that does some kind of DOS echo goodness, and you can append text to a file, nice and simple. Create a magic word to launch a particular application (even with commands) and voila. I’ve got some posts about SlickRun and the goodness you can do with it. Here, I want to talk about how you can use it to open a folder. Very simple, really.

    All you would do is create a magic word for every one of your favourite folders. Let’s say that my GTD folder is really important to me (holds miscellaneous GTD stuff, but important nonetheless). I create a new magic word, “gtdfolder” like this:

    And that’s it. Now, when I type “gtdfolder” into the SlickRun box, it automatically opens that particular folder in a new explorer window. No screenshot for that one - you all know what an explorer window looks like.

    This is a great way to open folders that you want to poke around in. Unfortunately, it’s not very useful when you’re already in a program and want to save a file to that particular folder.

    TweakUI Power Toy

    Microsoft has some fine, damn fine, power toys out there - very fun and functional. Tweak UI has been on my machine for years. I mostly use it to trim down the list of things I can create with a right-click (e.g., I’m not going to right-click on my desktop and create a new Word document - ain’t done). I also use it on some machines to handle an automatic login - so the computer is protected by a password, but my better half doesn’t need to remember it.

    Another thing TweakUI can do is play with the set of places that you find in Open/Save dialog boxes. I’ve never used it for this, but I’m about to try it out. Now, my default Open dialog box looks like this:

    Let’s go into TweakUI and see what we can do. Under the Common Dialogs option, you can choose up to 5 custom places. Unfortunately, you can’t tell it exactly what places you want, i.e., a specific folder. So, it’s customizable, but not too much. And, you’re still limited to 5.

    Now, I applied these changes, but I don’t think they’re going to show up until I reboot. And it’s not that exciting anyway. So no screenshot for that. I’m a little sad though - I never realized how limited this option was - I always thought you could choose whatever folders you wanted. Bummer.

    AutoHotkey

    AutoHotkey is a kick-ass keyboard macros-slash-text replacements-slash-scripting utility. I don’t use it to its full potential, but I do use it, mostly for text replacement. And this seems like the perfect solution to our problem. From the Tutorial page:

    Finally, keystrokes can also be sent in response to abbreviations you type, which are known as hotstrings. For example, whenever you type Btw followed by a space or comma, the following line will replace it with “By the way”:

    ::btw::by the way

    I’ve always got a monster ahk script running, containing a whack of hotstrings. For example, if I type .da I get today’s date, in short form, surrounded by square brackets. That’s just the sort of goodness you can do. The line above, ::btw::by the way is set up so that as soon as you type btw, followed by a space, comma, period, etc., then “by the way” is inserted instead. I tend to like my hotstrings so that I don’t need to type the ending character. That way, I don’t need to figure out how to get rid of the trailing space, period, etc. (I think there’s a way around that, but I haven’t bothered to figure it out.)

    So, let’s make a new hotstring for my favourite folder. It will look like this:

    :*:gtdfolder::f:miscellaneousgtd

    The * means, don’t wait for a character, as soon as “gtdfolder” is typed, change that to “f:\miscellaneous\gtd”. Now, when I’m in my open dialog box, the cursor is already placed in the “File name” box at the bottom of the dialog box. Simply type the hotstring for my favourite folder.

    Before the last letter:

    As soon as the last letter is typed. Notice that the last slash is not actually in my hotstring. Windows is smarter than me.

    Hit enter, and you navigate to your favourite folder:

    Now, what could be easier than that? It also works if you’re a user of the Windows Address Bar (it’s a toolbar that you can have in your task bar that gives you a place to type in directory names so you can quickly navigate to particular directories - easier than creating a new magic word for every directory. Right-click on your toolbar and play with it - it’s sadly under-appreciated.)

    Conclusion

    For this task, TweakUI is just not flexible enough. SlickRun is fine if you just want to explore different folders. But, if you’re talking about working with Open and Save dialog boxes, then AutoHotkey is the one for you. And, even better, it works in every program’s dialog box, not just those with the “My Places” section.