Remember the Milk Alfred Workflow

This uses rtm-cli which you can install with npm.

query=$1
logfile="/Users/bakert/u/scratch/rtm.log"
rtm=/opt/homebrew/bin/rtm
max_lines=1000

# Log the query
echo "[$(date)] $query" >> "$logfile"

# Ensure the logfile does not grow beyond $max_lines
tail -n $max_lines "$logfile" > "$logfile.tmp" && mv "$logfile.tmp" "$logfile"

# Send the task to Remember the Milk
"$rtm" add $query

if [ $? -ne 0 ]; then
  echo "SOMETHING WENT WRONG! Please check that rtm-cli is installed: npm install -g rtm-cli"
else
  echo "[Added] $query"
fi

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.