Save AutoHotkey Script Settings in Your Windows Registry

While You Can Use an External File to Save Your Script Defaults, You Can Also Call-on the Windows Registry to Store App Settings

In most cases, I’ve used a separate file (text or INI) to save settings. While this works well, it requires the creation and tracking of that independent file. For the script to read the settings, it must know where to locate that file. But, if you want to save script settings without the baggage of that extra file, then consider using your Windows Registry.

You’ll find a few advantages to maintaining your script settings in the Windows Registry:

  1. Unlike a separate settings file, you don’t need to keep track of the Windows Registry’s location—it never moves. Regardless of where you locate your AutoHotkey script on your computer, you will always find its settings in the exact same place.
  2. You won’t accidentally lose your settings by manually deleting what may seem like an extra file in Windows File Explorer.
  3. Your settings remain semi-hidden from public view in a semi-permanent form.

This approach to storing your script defaults deep inside the recesses of Windows adds an air of mystery to your apps—especially if you compile them into EXE files. Continue reading


Wrapping Up the DateStampConvert.ahk Script (AutoHotkey Tips)

In Previous Blogs, I Used Regular Expressions to ID Dates Formats in Documents and Simulated Case/Switch Statements to Convert Month Names to Numbers. Now, I Build the Standard DateTime Stamp, Check for Valid Dates, and Deal with Two-digit Years, Plus Use the Function ByRef Method to Bypass Local Variables.

While in conversations with a reader who uses AutoHotkey to calculate the time span between two dates for figuring out new leases, I realized that a tool which captures formatted dates from any document and converts them into the DateTime Stamp format (yyyymmdd) would make using the HowLongYearsMonthsDays.ahk script even easier. That prompted me to write the DateStampConvert.ahk script. Continue reading

Use the Ternary Operator to Create Conditional Case Statements or Switches (AutoHotkey Tip)

While AutoHotkey Does Not Include a Conditional Case Statement, You Can Build Your Own Using the Ternary Operator

Many programming languages include Case statements which act in a manner to similar a series of If…Else If…Else statements in an abbreviated form. The simplicity of the structure provides the primary benefit of offering a series of options in semi-list form Continue reading

Using Regular Expressions to Convert Most Formatted Dates into DateTime Stamps (AutoHotkey Tool)

AutoHotkey Offers Many Techniques for Converting the DateTime Stamp (yyyymmdd) into Formatted Dates, But What About Going in the Other Direction? Use RegEx to Identify Date Formats!

DateStampThe HowLongYearsMonthsDays.ahk function calculates the difference in years, months, and days between any two dates. To manually set the two dates, the script employs two DateTime GUI controls—input dates saved in the DateTime Stamp format (i.e. yyyymmdd) and the output in years, months and days. But wouldn’t you find it easier if you could highlight the dates in any document or Web page regardless of format, then use AutoHotkey to convert and copy the DateTime Stamps directly into the DateTime GUI controls? Continue reading

A New Hotstring Trick and Converting Dates in Documents into DateTime Stamps (Coming Soon!)

Making a List of Future Blogs While Sequestered

ProgrammingRobotRight now, the massive book of motley AutoHotkey tips consumes the vast majority of my time. Therefore, I have less blogging time. However, I don’t want my lack of blogs to make anyone think I sit idle. In the course of the current task at hand, I’ve accumulated even more topics which I need to blog about: Continue reading