In Most Data Fields, You’ll Find It Simple to Paste Text or Numbers, But Inserting a Parsed Date Often Requires Extra Steps—Plus How to Change Date Paste Action Based on the Active Window Title
In the first three blogs of this RegEx series, I used Regular Expressions (RegEx) to identify and parse data prior to any paste operations. In this blog, I use a RegEx to identify and parse dates during the multi-part date paste operation. I use the previously introduced \d wild card (any numeric digit zero through nine) and the optional match modifier (the question mark ?), plus, I introduced how to create a selection list of possible matches by using a range of options (in this case, a forward slash, a dash, or a dot [/\-.] as date separators).
* * *
When working with forms, dates often use three separate data entry fields—one for the month, one for the day, and one for the year. (In the UK, they swap it around to day/month/year.) In some forms, you need to enter a forward slash (/) to jump to the next entry item. Sometimes the form automatically jumps to the next field after entering two digits. In many Web pages, you need to tab between each data entry area. Sometimes, sending the entire copied date as a single string works.
Since I wrote the MultiPaste.ahk script to respond to a particular personal finance program, I set it up to Send the date delimited with slashes. If you want to do something similar for a different software package or Web page, then you may need to tailor the script. This blog shows you how to do that. Continue reading →