How can. Create a list of dates in a document?

Hello, I am using Google docs and find my self having to create a list of dates in a document each month. wit the below format (Date skip 2 lines next date, for the whole month). Is there a macro I can program that can automate that for me?

July 1, 2024

July 2, 2024

This could be an interesting topic, as I imagine there are about 400 ways to do this :).

The example I'm posting is almost assuredly not the best way to get it done, but it works and doesn't use any shell scripts or Perl, JavaScript, etc.—I suspect either of the latter two will provide a much more efficient way to get this done.

With that said, this seems to work, and accounts for leap year days in February.

Download Macro(s): date creator.kmmacros (7.1 KB)

Macro screenshot

Macro notes
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
    • The user must ensure the macro is enabled.
    • The user must also ensure the macro's parent macro-group is enabled.
System information
  • macOS 14.4.1
  • Keyboard Maestro v11.0.2

Run it, and you pick a date...

...and it then displays the result (and saves to a variable, ready for pasting via Insert Text by Pasting (or Typing)):

-rob.

Thanks this is great! Do you know if there is a way put the results on the system clip board? I am super new to all of this :slight_smile:

Sure, as a last action (you can delete the display one), just add this:

Set Clipboard to Text.kmactions (430 B)

-rob.

perfect. And. See now that was alluded to in your original post.. thanks again!

And if all you want to do is insert the text in the app you're in, and you don't really need it on the clipboard, you can replace the above with an Insert Text by Typing, and in the box in that action, just put %Variable%local_theFinalText%. That'll put it into the document you're in without changing the clipboard. (Or if you use Insert Text by Pasting, it will put it in the document and on the clipboard.)

-rob.

1 Like