Last active
February 28, 2016 18:43
-
-
Save craigeley/9509906 to your computer and use it in GitHub Desktop.
Set this script to run at various times using launchd to automatically add lines to TaskPaper files if they don't exist. A solution for recurring tasks for plain-text task management.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Change to your filepath in lines 9 and 12 | |
# Add your exact search term to line 9 | |
# Add your exact to-do in line 13 | |
require 'time' | |
today = Time.now.strftime('%Y-%m-%d') | |
if File.readlines('/Users/USERNAME/Dropbox/Listacular/list.taskpaper', encoding: 'UTF-8').grep(/TERM/).any? | |
exit | |
else | |
open('/Users/USERNAME/Dropbox/Listacular/list.taskpaper', 'a') { |f| | |
f.puts "- Do this task @due(#{today} 23:00)" + "\n"} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment