Updated script to create reminders or calendar events from tasks

This is based on the work of Brett. He created a script called nvremind that runs every so often in the background and creates reminders when certain tags are created in any of your TaskPaper files. This is the type of script that you just set and forget. The instructions and the script are available here.

I modified the script to also create events in my calendar. This works really well since it allows me to use 2do and fantastical in all of my computers. Here is a link to the script I modified to also add calendar events. The tags I use are @remind and @event. Once the script creates a reminder or event, the tags are changed to @reminded or @event_created. Disclaimer: I do not know any Ruby, but it has worked without a problem for several months now. Maybe @mattgemmell can update this script to use his Library and make the code easier to modify and read, but like I said before, it works!


Okay, I forgot that I had not saved my modifications to the file I had linked. Let me explain what I did and how it works. First, my script is not to remind me of events that are over due, but I modified it so that I can create reminders for things in the future. Lets say that I have this task.

  • Dr. Appointment @remind(2016-05-01 09:30)

My script which happens to run every half hour will create a reminder in the default list. If you have a particular list that you want to use, lets say “personal”, simply add the tag @list(Personal). I also modified the script to add calendar reminder.

  • Dr. Appointment @event(2016-05-01 09:30) @calendar(Personal)

You don’t have to add the time nor the calendar tag, but they are there in case you have a “Personal” calendar you want to add.

The script will ignore tasks that have the tag @done or @cancelled, and that have an event date that is older than the actual date and time. Once the tags have been processed, the tags are changed. So in the previous example, you will have something like this after the script creates the event or reminders,

  • Dr. Appointment @reminded(2016-04-01 12:00)
  • Dr. Appointment @event_created(2016-04-01 12:00) @calendar(Personal)

The date of the tag is changed to the date and time the event or reminder was created. If you want to keep dates, I would recommend you to add a @due date instead and just use the @event or @reminder tag to feed information to the script. Again, my ruby knowledge is very limited, but if you are free to play with the script and ask questions. Maybe somebody who knows more ruby can help you :smile:

Here is the link to my script. For instructions on how to install it, follow the link to Brett’s page mentioned in my original post. Here is a copy of my plist which goes in my ~/Library/Launch Agents/local.job.plist which is kind of self explanatory. This runs the script every half hour.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
1 Like

I’m trying to get this working, but this is the error I receive when running directly from terminal…

Mac-mini:Scripts Elliott$ ruby nvremind.rb -mz /Users/Elliott/Dropbox/Tasks

nvremind.rb:285:in `block (3 levels) in process_command': undefined method `[]' for nil:NilClass (NoMethodError)
    from nvremind.rb:270:in `map!'
    from nvremind.rb:270:in `block (2 levels) in process_command'
    from nvremind.rb:261:in `each'
    from nvremind.rb:261:in `block in process_command'
    from nvremind.rb:258:in `each'
    from nvremind.rb:258:in `process_command'
    from nvremind.rb:150:in `run'
    from nvremind.rb:555:in `<main>'`

Any ideas?

Are you using the copy of the script I provided? I remember that back in the day when I tried to get the original script, I couldn’t get it to run; but I forget why. Please download the file I modified and tell me if that one works. I named mine simply nvermind without the “.rb” file ending.

Here is my modified script.

Yep that’s the one I’m using, I’ve tried it with and without adding the .rb to it but it still doesn’t work. I’m using OS X 10.11 is that the same as yourself?

Like I said before, I am very, very new to ruby; but I can try to help you catch the bug. Try running the file in verbose mode “-Vmz”. Also make sure that the user has executable permissions to the file.

The first thing I would try is to point to an empty folder and see what happens. If that crashes, send the reports. If it doesn’t crash, add a file at a time until you find which one is causing the error.

Really appreciate your help with this. But regardless of your experience with Ruby, it will be more than mine (I’ve never used it). Here’s what happens when run in verbose mode with an empty folder location…

Mac-mini:dropbox Elliott$ ruby nvremind -Vmz ~/dropbox/temp/
Start at 2016-04-04T23:52:41+10:00

  remove = false
  preserve_time = true
  verbose = true
  notify = false
  email = false
  file = false
  stdout = true
  reminders = true
  reminder_list = Reminders

Finished at 2016-04-04T23:52:41+10:00

And here’s what happens when i add a simple .taskpaper file into that folder (also tried it as .txt and .md)…

Mac-mini:dropbox Elliott$ ruby nvremind -Vmz ~/dropbox/temp/
Start at 2016-04-04T23:57:28+10:00

  remove = false
  preserve_time = true
  verbose = true
  notify = false
  email = false
  file = false
  stdout = true
  reminders = true
  reminder_list = Reminders

nvremind:285:in `block (3 levels) in process_command': undefined method `[]' for nil:NilClass (NoMethodError)
	from nvremind:270:in `map!'
	from nvremind:270:in `block (2 levels) in process_command'
	from nvremind:261:in `each'
	from nvremind:261:in `block in process_command'
	from nvremind:258:in `each'
	from nvremind:258:in `process_command'
	from nvremind:150:in `run'
	from nvremind:555:in `<main>'

For reference, the taskpaper file simply contains the following…

- task number one @remind(2016-04-10 10:00)
- task number two @remind(2016-04-20 20:00)

File permission are 777. I’ve upgraded to the latest version of ruby as well.

I found the mistake. I will rework the code in a minute, but if you want to get it to work right away, just put a comment (with #) on line 285

Okay. The problem in the code was in a line that stripped some tags. The problem is that the code was not checking to see if the tag was actually there before it stripped it. Since I usually use those tags, I was not getting that error. Thank you for pointing that out. I updated all the links to point to the new versions that shouldn’t have that error. Please check and let me know if it works :slight_smile:

Excellent! it now works. Thanks very much for the modifications.

dohwan-Kims-MacBook-Pro:~ Telemachus$ ruby /usr/local/bin/nvremind.rb -Vmz /Users/Telemachus/Documents/papers/files/my_journal/Dropbox/nvALT/taskpaper3/testTask.taskpaper
Start at 2016-06-10T14:51:39+09:00

  remove = false
  preserve_time = true
  verbose = true
  notify = false
  email = false
  file = false
  stdout = true
  reminders = true
  reminder_list = Reminders
/usr/local/bin/nvremind.rb:259:in `chdir': Not a directory - /Users/Telemachus/Documents/papers/files/my_journal/Dropbox/nvALT/taskpaper3/testTask.taskpaper (Errno::ENOTDIR)
	from /usr/local/bin/nvremind.rb:259:in `block in process_command'
	from /usr/local/bin/nvremind.rb:258:in `each'
	from /usr/local/bin/nvremind.rb:258:in `process_command'
	from /usr/local/bin/nvremind.rb:150:in `run'
	from /usr/local/bin/nvremind.rb:560:in `<main>'
dohwan-Kims-MacBook-Pro:~ Telemachus$ 

I can’t get it. is there any thing I miss?

No problem,

By reading your log files, it seems that you are not typing the right location of your document when you write the nvremind.rb -Vmz PATH. Try putting something a task paper file in your desktop and then running ruby nvremind -Vmz ~/desktop/filename.taskpaper and see if that works. Hope this helps.

…at my case

nvremind.rb -option 'pathname' (ex. ~/dropbox/nvalt/) => it works!

full path and filename.taskpaper => it doesn’t work.


Mmmm… It works on my side when using the whole path too. You should try copying the path from the finder itself.

Thanks very much for doing this. I could never get Brett’s script to work for some reason (now lost in the mists of time) but yours works a treat. I’m having no luck getting Launch Agent to autorun it, but debugging that is outside the scope of your work here. I’ll keep banging on it, but I miss cron :slight_smile:

Anyway, appreciations!

It would be no problem for me to help you getting your script working with the Launch Agent, but I am about to walk out of the door to leave on a backpacking trip with the family and will not be back until next Monday. Your could try downloading something like “Launch Control” and use it. It is a lot easier to get it working through the program, and if you are planning on using it more than once, the price is very reasonable. You could also try to post your problems here. The most active users are a whole lot more knowledgeable than me and could be a better help too. Hope you get it. Have a good weekend!!

Hey thanks. After a bunch of messing around to varying degrees of success, I’m using Launch Control, and that is slightly easier than editing the plist files (though I am still unclear on the concepts of how to get agents to unload and load again for testing).

The issue I was having was that when running from the agent, the script would change the tags in my file, but not actually add reminders. However, the same command copy’n’pasted to the command line would work. This appears to have been an artifact of messing around trying to understand loading/unloading (at one point I actually saw two instances of reminders.app running so I know I was doing something Very Wrong), as it seems to be working now. So, I think that’s working.

One issue I am still having is that the script seems to add a calendar event to whatever calendar I happen to have in focus in calendar.app, regardless of the @calendar tag or what I have my default calendar set to in calendar.app. Any information I can give you to help with debugging that?

Did you figure it out? I honestly didn’t read this last part of your post until today. I am wondering if it is working now!

Does it compatible with Big Sur From the Brett page the script is not maintained anymore? Has someone have amended this script in apple script? Like the repeat script? Thanks for the answer.

It should make exactly what I need create an event in Calendar from Taskpaper, need just one more thing is the end time to be able to use the time blocking method.


This script became “useless” once TaskPaper added some of this functionality. Check the documentation to see how TaskPaper does this. I am sharing the link just in case this script works better for you. Not sure if it is compatible with Big Sur, but it should be easy to make it work. Create another post if you need help making this one work.