22.00.0094: Don’t type the date by hand

https://johnnydecimal.com/20-29-communication/22-blog/22.00.0094-dont-type-the-date-by-hand/

On Discord, Jade asked:

Theres gotta be a better way of naming Amex (and other credit card statements) than this surely? I always struggle to remember the dates, but this just feels overwhelming, I usually just go with the statement date for naming credit card statements. Amex Ending 12345 - 2024 10 10 to 2024 11 09 - Statement 2024 11 09 - Due 2024 12 05

There are many situations where I recommend starting a filename (or folder) with the date. It works really well for almost any time-based document. Amex statements fall squarely in to that bucket.

Which date?

For the record, this is the ISO 8601 date standard. Once you get in to date formatting[1] you’ll see that around, so it’s good to know what it is.

That standard defines a bunch of formats, but the one we’re interested in is the simple yyyy-mm-dd, i.e. 2024-11-21. It’s the only sensible format for your computer dates as it sorts chronologically. Use whatever other weird crap you want in your personal life.

The problem with this date is that it’s a real pain to type out by hand. And first you have to remember the date! Bo-ring. Fortunately computers are good at a) knowing the date and b) generating text.

Introducing Raycast

You’re gonna need an app. There are many that do this. The venerable TextExpander might have been the first, but we’re going to use a reasonably new app: Raycast.

Raycast is a beast. It does so much. But don’t let that put you off – we can start to use it for the stuff we need, and over time you can explore the rest of its features.

It’s free. There’s a pro plan, but you don’t need it. It’s currently Mac only, but they’re working on a Windows version.

So, install it. You can test it’s working by pressing Option-Space. A little window should appear in the middle of your screen.

I won’t go over any other Raycast features just now. The manual is here.

Snippets

We’re going to create a ‘snippet’. How this works is that you type some sort of shortcut, and Raycast converts it to something else.

It’s just like the feature on your iPhone that detects if you typed teh and corrects it to the. Or the one that corrects █uck to duck. You know.

There’s a trick here, and it’s in naming your snippets. You want to guarantee that whatever you type will never ever occur in normal daily typing. Because if your snippet trigger was al, every time you type that out Raycast will replace it for you.

So now instead of Johnny.Decimal you’ll get Johnny.Decim2024-11-21. Not ideal.

I recommend ;;

I think this came from Merlin Mann waaaay back in the 43 folders days (2005!).[2] If you start each of your snippets with two semicolons, you guarantee that you’ll never trigger them by accident.

If you touch-type[3] they’re under your right pinkie. So you mash ;; and then the name of your snippet and boom Raycast steps in and replaces it with something else.

Let’s drop a little video here in case you’re wondering what I’m on about.

Link to video (dark mode version).

Raycast: Create Snippet

Cool eh! Let’s set it up.

  1. Activate Raycast with ⌥ Space. Type create snippet to find that command. Press return.
  2. The Name helps you identify it in the future.[4] Call it YYYY-MM-DD or whatever else you like.
  3. The Snippet is what will appear when this is activated. Paste this in: {date format="yyyy-MM-dd"}. This is a little bit of code that Raycast understands. Include the curly brackets.
  4. Scroll the window to reveal Keyword. This is what you type to activate this snippet. I’d recommend ;;date for this one.
  5. Press ⌘ return to save it.
  6. Try it out!

Problem: it’s today’s date

As Jade is renaming lots of old files, this isn’t perfect. But honestly I find even having the skeleton of a date format that I can then edit is more useful than starting from nothing.

Tip: use option-arrows to move around

Another small computer power-user tip: hold option (alt on Windows) and use the left/right arrows. This jumps your cursor a word at a time, and it stops at the breaks between the numbers in the date.

This will speed up your editing.

Why stop there?

In Jade’s specific case, where she wants yyyy-mm-mm Amex 12345, there’s nothing stopping you creating another custom snippet for that whole piece of text.

Repeat the process but now the Snippet should read {date format="yyyy-MM-dd"} Amex 12345. Maybe give that one the keyword ;;ax1? Whatever makes sense to you.

We can do so much more with Raycast, but that’s a good start. Let us know how that works for you, Jade!


  1. You will. Just wait. ↩︎

  2. Archive link in case that’s down. ↩︎

  3. And if you don’t, learn. ↩︎

  4. Raycast command search snippets will list them. ↩︎

Yes to using text expanders! :clap: I only started using one fairly recently and I can’t imagine going back now.

For those looking for a cross-platform and/or open-source solution, I can highly recommend Espanso. It’s just one guy’s passion project but it works flawlessly.

Also, to follow up on your remark on tailoring the snippets to task at hand: It’s good to keep in mind that snippets don’t have to be universal nor permanent. Specialised one-off snippets can be very useful in certain scenarios. If the snippet saves you even a couple minutes of your time it’s already worth the extra effort.

Yes! I need to learn this. I resist creating new snippets which makes no sense.

Thanks for Espanso, looks great. FYI the reason I specifically went with Raycast is that next we’re going to blow Jade’s mind by showing her the clipboard manager next… :upside_down_face:

Oh boy, I’ll be waiting for this to learn something new!