Daily Reminder List for TaskAgent

This is a workflow for sending a daily list of recurring reminders to TaskAgent but it could probably be adapted to other list managers, such as TaskPaper.
The workflow has three components: a plain text file, a shell script, and Hazel.
Text File
I keep a list of recurring reminders in a plain text file called “calendar.txt” (you can call it anything you like). The file is read by a Unix command, "calendar".
The format is simple, one reminder per line:
day or date <tab> description
For example,
Friday Weekly Review
where “Friday” and “Weekly Review” are separated by a tab.
When the Unix calendar command is run, this will display the description “Weekly Review” every Friday.
Some other examples:
10 * Check tire pressure
This will display “Check tire pressure” every month on the 10th.
Once you have your text file set up, you can test it with this command in Terminal:
calendar -f /Users/your_username/Documents/calendar.txt -A 0
That will show you the reminders for today.
If you like, you can try it out with a test date with the -t option, for example to display reminders for January 24, 2014 use:
calendar -f /Users/your_username/Documents/calendar.txt -A 0 -t 24.1.2014
The -t option takes the format of day.month.year with the month and year being optional. Or you can use a day of the week:
calendar -f /Users/your_username/Documents/calendar.txt -A 0 -t friday
Shell Script
The shell script runs the calendar command to get today’s reminders, adds a hyphen to the beginning of each line, and removes asterisks in the dates. The output is appended to a file called Today.txt in the TaskAgent folder in Dropbox.
Since TaskAgent uses plain text files, the file “Today.txt” appears updated daily in TaskAgent, as a list called Today (along with those previous reminders that I didn’t get around to doing!).
Hazel
Hazel runs the shell script every morning.
Mac OS 10.9, Hazel 3.2.2, TaskAgent 1.1.1 for Mac, TaskAgent 3.0.2 for iOS 7
The workflow has three components: a plain text file, a shell script, and Hazel.
Text File
I keep a list of recurring reminders in a plain text file called “calendar.txt” (you can call it anything you like). The file is read by a Unix command, "calendar".
The format is simple, one reminder per line:
day or date <tab> description
For example,
Friday Weekly Review
where “Friday” and “Weekly Review” are separated by a tab.
When the Unix calendar command is run, this will display the description “Weekly Review” every Friday.
Some other examples:
10 * Check tire pressure
This will display “Check tire pressure” every month on the 10th.
Once you have your text file set up, you can test it with this command in Terminal:
calendar -f /Users/your_username/Documents/calendar.txt -A 0
That will show you the reminders for today.
If you like, you can try it out with a test date with the -t option, for example to display reminders for January 24, 2014 use:
calendar -f /Users/your_username/Documents/calendar.txt -A 0 -t 24.1.2014
The -t option takes the format of day.month.year with the month and year being optional. Or you can use a day of the week:
calendar -f /Users/your_username/Documents/calendar.txt -A 0 -t friday
Shell Script
The shell script runs the calendar command to get today’s reminders, adds a hyphen to the beginning of each line, and removes asterisks in the dates. The output is appended to a file called Today.txt in the TaskAgent folder in Dropbox.
- Code: Select all
#!/bin/sh
# This script creates a TaskAgent list
ListFile=/Users/your_username/Dropbox/Apps/TaskAgent/Today.txt
CalendarFile=/Users/your_username/Documents/calendar.txt
# add a linefeed if last line is incomplete
Line=`tail -1c $ListFile | wc -l`
if [ $Line=0 ] ; then
echo » $ListFile
fi
# add a hyphen to the start of the line, remove the asterisk
calendar -f $CalendarFile -A 0 | sed ‘s/^/- /g’ | sed ‘s/\*//g’ » $ListFile
Since TaskAgent uses plain text files, the file “Today.txt” appears updated daily in TaskAgent, as a list called Today (along with those previous reminders that I didn’t get around to doing!).
Hazel
Hazel runs the shell script every morning.
Mac OS 10.9, Hazel 3.2.2, TaskAgent 1.1.1 for Mac, TaskAgent 3.0.2 for iOS 7