Single key access to date-stamped note files for Today, Tomorrow, etc

I do much of my daily thinking, outlining and planning in a single date-stamped text file for today, sometimes putting things into tomorrow's file in advance, or copying things over from yesterday's file.

Here are 3 macros for one-key creation and/or opening of today's, yesterday's and tomorrow's files.

dateStampedNoteFiles.kmmacros (105.6 KB)

an additional macro lets you change the settings for:

  • the folder in which date-stamped notes are kept,
  • their filename prefix and extension,
  • and the app which opens them.

NB adjust and test the app name and note folder settings to get a match with your needs and setup:

Additional macros of this kind (two days ago, seven days from now, etc) can be quickly created by editing a single value:

+0d → today
-1d → yesterday
+2d → two days hence
+1w → seven days from now

etc

The shell script, FWIW, looks like this:

wkg="$HOME/$KMVAR_NoteFolder"
notePrefix="$KMVAR_NotePrefix"
fileExtn="$KMVAR_NoteExtn"
app="$KMVAR_NoteApp"

# See (in BASH date, the -v flag) 
# "-v-1d" --> yesterday
# "-v+1d" --> tomorrow
# "" --> today (default)
if [[ -z "$KMVAR_NoteDateAdjust" ]]; 
then
	dateAdjust=
else
	dateAdjust="-v$KMVAR_NoteDateAdjust"
fi

noteDate=$(date $dateAdjust "+%Y-%m-%d")
dayfile="$wkg/$notePrefix$noteDate.$KMVAR_NoteExtn"
touch "$dayfile"

open -a "$app" "$dayfile"
1 Like

PS I am beginning to keep my daily notes and outlines in the beta of Jesse Grosjean's FoldingText for Atom,

so having specified Atom as the default App for opening the .ftml extension,

My own settings for this family of macros are currently:

dateStampedFilesForTodayEtc.kmmacros (105.6 KB)

1 Like