Legal Dates with TextExpander

Attorneys are weird.

When we send pleadings to the court we format our date odd ways and typically sign things off with phrases like "Respectfully submitted this 6th day of January, 2017." Or, "I hereby certify a true and correct copy of the foregoing was sent to the attorney for the defendant on 6th day of January, 2017."

I've long known that I could use TextExpander can easily insert dates into documents and format those dates, but I never could figure out how to get the suffix to properly attach to the day. I sent out a tweet for help and David Friedman (@iconicsans) came up with a link to this post by David Galletly on Adding Date Suffixes with TextExpander that will do the job with AppleScript.

You actually have to create two TextExpander snippets to make this work. Step one is to create an AppleScript snippet that gets the day of the month and will format it with the proper suffix. It looks like this:

The first snippet uses AppleScript to create the day with the appropaite suffix.

The first snippet uses AppleScript to create the day with the appropaite suffix.

The next snippet is a simple date snippet that will pull the day of the month snippet and use it to complete your text as you like. Mine looks like this:

The second snippet brings it all together, a traditional TextExpander date snippet integrating the first snippet.

The second snippet brings it all together, a traditional TextExpander date snippet integrating the first snippet.

I love it when a bit of automation will solve an everyday problem. Check out David Galletly's post with more information and a video explaining the process.

 Update: I received a tweet from @TextEpander who pointed out that the suffix problem can be solved with JavaScript too. The beauty of using a JavaScript soution is that the created snippet will work on iOS as well. If that's important, check out this post and replace the AppleScript portion with JavaScript.