Idea for monthly recurring tasks with Keyboard Maestro + Cron

I keep recurring monthly tasks by inserting a list of them at beginning of each month in my Bullet Journal-inspired setup of the Agenda.

This works best by creating a note for that particular month (i. e. a “Month Plan”), with the note’s date set to the current month’s first and last days so that it will naturally stay on top of the daily notes during the whole period.

To be true, I’ve got lazy with time to keep creating this note each month, and I started to simply dump the tasks into some daily note at the beginning of the month.

But it just occurred to me that’s being a while since Agenda’s URL Scheme got parameters for the start-date and end-date when creating a note, so that the creation of a note for the month could be easily automated. So I came with this script, which I trigger with a Keyboard Maestro macro:

export LC_ALL="pt_BR" # use your own local settings

TITLE=`date +'%B %Y'`
DATE_START=`date +'%Y-%m-01'`
DATE_END=`date -j -f '%Y-%m-%d' -v "+1m" -v "-1d" ${DATE_START} +'%Y-%m-%d'`
TEXT="### Monthly routines

- [ ] Issue invoices
- [ ] Pay taxes
- [ ] Pay phone bill"

open "agenda://x-callback-url/create-note?select=true&project-title=${PROJECT}&title=${TITLE}&start-date=${DATE_START}&end-date=${DATE_END}&text=${TEXT}"

The macro can be used manually, but because Keyboard Maestro has a Cron trigger, it can also be automatically invoked at the start of each month:

I hope you enjoy it!

1 Like

Thanks for sharing @bruno1, great use of the call back urls!

1 Like