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

Find this article at: http://www.labnol.org/software/tutorials/simple-diary-tutorial-with-autohotkey/4902/

Tags: , , , Tips, Tricks, Tutorials

Reader Comments

Nice! I really like these small scripts. Simple, smart, efficient.

Thanks for sharing :)

But you can create a simple diary with in seconds by following method.

1. Open notepad and type “.LOG” without quotes, save the file as dairy. That’s all.
2. Just open the file “diary.txt” and you can see the time stamp being generated.

Nagaraju – Here you don’t have to open notepad – just type your thoughts in the inbox box and it automatically gets saved (or rather appended) into an existing text file.



Google Custom Search