/* AutoHotkey Version: 2.x This AutoHotkey script uses version 2.0 functions and won't run under version 1.1. The .ahk2 file extension denotes all V2.0 scripts and can be compared to the sister 1.1 scripts with the .ahk extension. For more information about how to run both V1.1 and V2.0 simultaneously, see: https://jacksautohotkeyblog.wordpress.com/2018/01/11/how-to-fool-around-with-the-new-autohotkey-version-2-0/ */ SendMode Input ^#!F1:: ; Add date/time stamp SendInput A_Now Return ^#!F2:: ; Add today's date formatted ; FormatTime, TimeString, %A_Now%, MMMM d, yyyy TimeString := FormatTime(A_Now,"MMMM d, yyyy" ) SendInput(TimeString) Return ^#!F3:: ; Add today's date formatted TimeString := FormatTime(A_Now,"ddd, MMMM d, yyyy" ) SendInput TimeString Return ; This next example is a little more advanced form which opens ; a calendar for selecion. The AddDate name is added to avoid GUI ; conflicts and the If WinExist() = 0 condition is used to avoid errors ; while maintaining the last selected data as a default. ; ; ^#+d:: DetectHiddenWindows "On" If WinExist("Select Date") = 0 { Global AddDate, MyCal, DayPick AddDate := GuiCreate() AddDate.Title := "Select Date" MyCal := AddDate.Add("MonthCal", "vDayPick",DayPick) MyBtn := AddDate.Add("Button", "Default", "Submit").OnEvent("Click", "MyBtn_Click") ; MsgBox "New Gui" } AddDate.Show DetectHiddenWindows "Off" Return MyBtn_Click() { DayPick := MyCal.Value AddDate.Hide TimeString := FormatTime(DayPick,"MMMM d, yyyy") Send TimeString } :c*:Mdate:: ; Hotstring to pick date with above calendar Hotkey. Capital M required. SendInput "^#+d" Return :c*:Rnow:: ; Hotstring to immediately add today's date formatted. Capital R required. TimeString := FormatTime(,Long) SendInput TimeString Return /* Test Area */