Tutorial: Create a Simple Diary with Autohotkey

Autohotkey is an free software utility that allows users to automate repetitive tasks. For this example, we’ll create a simple script that can be invoked by pressing a keyboard shortcut and it lets you capture thoughts from any other program.

Assuming that you have already installed Autohotkey, copy paste the following script into notepad and save the file as, say, “diary.ahk” – always use quotes for the file name else Notepad will add the .txt extension to the script.

^!A::
  ; Show the Input Box to the user_._
  inputbox, text, Diary,,,300,100

  ; _Format the time-stamp._
  current=%A_DD%/%A_MM%/%A_YYYY%, %A_Hour%:%A_Min%

  ; _Write this data to the diary.txt file._
  fileappend, %current% - %text%\`n, diary.txt
return

autohotkey guiNow double-click the above file for Autohotkey to create a simple diary application – you can trigger this application from any application in Windows by pressing the the Ctrl+Alt+A keyboard shortcut.

The entries are stored in the diary.txt file in the same directory with automatically generated time stamps.

autohotkey output

Amit Agarwal

Amit Agarwal

Google Developer Expert, Google Cloud Champion

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India.

Amit has developed several popular Google add-ons including Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

Awards & Titles

Digital Inspiration has won several awards since it's launch in 2004.

Google Developer Expert

Google Developer Expert

Google awarded us the Google Developer Expert award recogizing our work in Google Workspace.

ProductHunt Golden Kitty

ProductHunt Golden Kitty

Our Gmail tool won the Lifehack of the Year award at ProductHunt Golden Kitty Awards in 2017.

Microsoft MVP Alumni

Microsoft MVP Alumni

Microsoft awarded us the Most Valuable Professional (MVP) title for 5 years in a row.

Google Cloud Champion

Google Cloud Champion

Google awarded us the Champion Innovator title recognizing our technical skill and expertise.

Email Newsletter

Sign up for our email newsletter to stay up to date.

We will never send any spam emails. Promise.