Highlighting text made easy.

As I continue training for my new job doing tech support for Microsoft, I have been taking lots of notes using Microsoft OneNote. which is part of the Office 2010 suite. I create individual notebooks for each topic covered in class and create pages for each lesson, complete with screenshots and links to related web sites. I also find myself doing quite a bit of highlighting to help me remember the important points covered by the instructor during the lectures. The keyboard shortcut for highlighting a selected block of text is Ctrl + Alt + H. Pretty awkward.
Then I thought of creating a script using AutoHotkey to make it possible to highlight text using only the mouse and never have to touch the keyboard again, well, except for typing more notes. All it takes is this one little line.

MButton & WheelUp::Send ^!h

With this script running I can continue selecting the text to be highlighted as usual, but when I’m ready for the actual highlighting, I just hold down the middle mouse button and scroll up at the same time,  which is the  hotkey for sending the Ctrl + Alt + H keystroke that highlights the selected text.
It’s amazing how one line of code can save tons of time.

AutoHotkey piano.

The very second I found out that AutoHotkey has a command for sounding a beep through your speakers, I immediately thought of creating a nonsense script that lets you play your keyboard like a piano. And here it is.

#piano.ahk
*z::SoundBeep, 262,100
*s::SoundBeep, 277,100
*x::SoundBeep, 294,100
*d::SoundBeep, 311,100
*c::SoundBeep, 330,100
*v::SoundBeep, 349,100
*g::SoundBeep, 369,100
*b::SoundBeep, 392,100
*h::SoundBeep, 415,100
*n::SoundBeep, 440,100
*j::SoundBeep, 466,100
*m::SoundBeep, 494,100
*,::SoundBeep, 523,100
*l::SoundBeep, 554,100
*.::SoundBeep, 587,100
*;::SoundBeep, 622,100
*/::SoundBeep, 659,100
*q::SoundBeep, 523,100
*2::SoundBeep, 554,100
*w::SoundBeep, 587,100
*3::SoundBeep, 622,100
*e::SoundBeep, 659,100
*r::SoundBeep, 698,100
*5::SoundBeep, 739,100
*t::SoundBeep, 783,100
*6::SoundBeep, 830,100
*y::SoundBeep, 880,100
*7::SoundBeep, 932,100
*u::SoundBeep, 987,100
*i::SoundBeep, 1046,100
*9::SoundBeep, 1109,100
*o::SoundBeep, 1175,100
*0::SoundBeep, 1244,100
*p::SoundBeep, 1318,100
*[::SoundBeep, 1397,100
*=::SoundBeep, 1480,100
*]::SoundBeep, 1568,100
*\::SoundBeep, 1760,100

I used this page to set the approximate frequencies of the musical notes, including those for sharps and flats. The “Z” key  is middle C and the “Q” key is higher C. While this script is running you won’t be able to use your keyboard for anything but making weird beeps, which is the last thing your boss wants to hear during his regular strolls through your office. You have been warned.

Getting started with AutoHotkey.

I’ve decided to give AutoHotkey a try and downloaded the no-install version for use on my USB thumb drive. When I ran it, it created a sample script file called AutoHotkey.ahk in your My Documents folder. Not exactly something I’d want happening if I were to run AutoHotkey on a public computer, such as one at the library. After doing some research online to determine a workaround, I learned I can copy this sample script to the application folder and rename it to AutoHotkey.ini, so when I run it from my thumb drive, the script contained in the INI file will automatically run.
I don’t know about you, but I prefer having AutoHotkey ask me which script file I want to open when I run it, so I replaced the contents of AutoHotkey.ini with this little script:

FileSelectFile, SelectedFile, 3, , Open a file, AutoHotkey Scripts (*.ahk)
if SelectedFile =
MsgBox, Nothing to do!
else
Run, AutoHotkey.exe “%SelectedFile%”

The script runs like a charm.
As a longtime user of AutoIt, I’m finding the AutoHotkey commands very easy to learn. At this point I don’t know which of the two scripting utilities are better but I am sure the answer will reveal itself over time.

Thank you letter generator script.

After interviewing for a job, it’s important to send a letter to the prospective employer thanking him or her for taking the time to interview you. It’s also an ideal opportunity to summarize why you are the perfect match for the job as well as bring up anything you might have neglected to mention that would also help you get hired. But the hardest part is actually taking the time to write the letter and even worse, having the letter ready to mail that same day. This isn’t easy if you want the letter to help you stand out from the other candidates.
This is an AutoIt script I wrote that generates a thank you letter for a technical support position. Before running this script, change the words in red to match your identity and location.
When you run the script, you will be asked some questions about your interviewer’s name, company, address and the job you interviewed for. Then the script pauses to allow you to load your word processor and when you click OK, you have 5 seconds to switch to the word processor so you can click in the document window in preparation for the automatic typing about to begin. And of course, you can change the document to match your interview, which is much less time consuming than creating a new document from scratch.
I hope this script serves you well.

#thanky.au3

$tname = InputBox(“Thanky”, “Was your interviewer a Mr. or Mrs?”)
$fname = InputBox(“Thanky”, “First name of interviewer:”)
$lname = InputBox(“Thanky”, “Last name of interviewer:”)
$jname = InputBox(“Thanky”, “Interviewer’s job title:”)
$cname = InputBox(“Thanky”, “Company name:”)
$cadd1 = InputBox(“Thanky”, “Company Address:”)
$cadd2 = InputBox(“Thanky”, “Company City, State and ZIP:”)
$job = InputBox(“Thanky”, “Job you interviewed for:”)
Msgbox (16, “Thanky”,”Load up your word processor and click OK to continue.”)
Msgbox (48, “Typer”,”You have 5 seconds before I start typing.”, 5)
Send (“YourName{ENTER}”)
Send (“YourAddress{ENTER}”)
Send (“YourCity, YourState, YourZIP{ENTER}{ENTER}”)
If @MON=1 then
$mon=”January”
elseif @MON=2 then
$mon=”February”
elseif @MON=3 then
$mon=”March”
elseif @MON=4 then
$mon=”April”
elseif @MON=5 then
$mon=”May”
elseif @MON=6 then
$mon=”June”
elseif @MON=7 then
$mon=”July”
elseif @MON=8 then
$mon=”August”
elseif @MON=9 then
$mon=”September”
elseif @MON=10 then
$mon=”October”
elseif @MON=11 then
$mon=”November”
elseif @MON=12 then
$mon=”December”
EndIf
Send ($mon & Chr(32) & @MDAY & “,” & Chr(32) & @YEAR & chr(13) & chr(13))
Send ($fname & chr(32) & $lname & chr(13))
Send ($jname & chr(13))
Send ($cname & chr(13))
send ($cadd1 & chr(13))
send ($cadd2 & chr(13) & chr(13))
send (“Dear ” & $tname & chr(32) & $lname & “,{ENTER}{ENTER}”)
send (“Thank you for taking the time to discuss the ” & $job & ” position at ” & $cname & ” with me. After meeting with you and observing the company’s operations, I am further convinced that I am an ideal match for this position with my experience working in similar environments in my previous jobs.{ENTER}{ENTER}”)
send (“I really appreciate that you took so much time to acquaint me with the company. I feel I could learn a great deal from you and would certainly enjoy working with you.{ENTER}{ENTER}”)
send (“In addition to my qualifications, I will bring excellent work habits and judgment to this position. With the countless demands on your time, I am sure that you require people who can be trusted to carry out their responsibilities with minimal supervision.{ENTER}{ENTER}”)
send (“I look forward, ” & $tname & chr(32) & $lname & “, to hearing from you concerning your hiring decision. Again, thank you for your time and consideration.{ENTER}{ENTER}”)
send (“Sincerely,{ENTER}{ENTER}{ENTER}{ENTER}”)
send (“YourName“)

Here’s an AutoHotkey version of this same script.

InputBox tname, Thanky, Was your interviewer a Mr. or Mrs?
InputBox fname, Thanky, First name of interviewer:
InputBox lname, Thanky, Last name of interviewer:
InputBox jname, Thanky, Interviewer’s job title:
InputBox cname, Thanky, Company name:
InputBox cadd1, Thanky, Company Address Line #1:
InputBox cadd2, Thanky, Company Address Line #2:
InputBox job, Job you interviewed for:
MsgBox,0, Thanky, Load up your word processor and click OK to continue.
MsgBox, 0, Thanky, You have 5 seconds before I start typing., 5
Send [YourName]{Enter}
Send [YourAddress]{Enter}
Send [YourCity, YourState, YourZIP]{Enter}{Enter}
Send %A_MMMM%{Space}%A_DD%,{Space}%A_YYYY%{Enter}{Enter}
Send %fname%{Space}%lname%, %jname%{Enter}
Send %cname%{Enter}
Send %cadd1%{Enter}
Send %cadd2%{Enter}{Enter}
Send Dear %tname%{Space}%lname%,{Enter}{Enter}
Send Thank you for taking the time to discuss the %job% position at %cname% with me. After meeting with you and observing the company’s operations, I am further convinced that I am an ideal match for this position with my experience working in similar environments in my previous jobs.{Enter}{Enter}
Send I really appreciate that you took so much time to acquaint me with the company. I feel I could learn a great deal from you and would certainly enjoy working with you.{Enter}{Enter}
Send In addition to my qualifications, I will bring excellent work habits and judgment to this position. With the countless demands on your time, I am sure that you require people who can be trusted to carry out their responsibilities with minimal supervision.{Enter}{Enter}
Send I look forward, %tname%{Space}%lname%, to hearing from you concerning your hiring decision. Again, thank you for your time and consideration.{Enter}{Enter}
Send Sincerely,{Enter}{Enter}{Enter}{Enter}
Send [YourName]