Fantastically Good Reminder Parser

A companion action to my previous Fantastically Good Event Parser, this time for adding reminders to the Reminders app. Supports natural language date and time entry and other Fantastical-style functionality.

More details on my blog.

Here’s a direct link to the Action Directory.

5 Likes

Again, this is awesome and perfect for what I need. Thanks @pdavisonreiber!!

If you already downloaded this, I just fixed a bug where alarms were not working properly. Now updated in the action directory.

https://actions.getdrafts.com/a/1MR

I was checking the code trying to figure this out but it’s too complicated for me. Do you think it’s possible to add an ignore-line tag to the action?

The iteration I’m thinking: a list with pending tasks and then, when I decide to do next one, delete the list hook, add a date, and launch the action.

1 Like

Is there any way to parse a location reminder? I can’t figure that out. Thanks. Looks great.

Not at the moment unfortunately.

Yes, this is actually quite simple to achieve. The only bit of the script you need to edit is the for loop right at the end. You just need to add a condition to check whether the line contains a certain string, and then only apply the function when it doesn’t. Something like this perhaps:

for (let line of lines) {
	if (!string.includes("#")) {
		makeReminder(line);
	}
} 

This would force the script to ignore all lines containing a # character. You could customise this as you like.

1 Like

I’m trying to consider a version of what you made that would parse a page from a journal in drafts and add events and tasks to fantastical by finding a character and then using that line to add either a event or a task.

* Bullet points / asterisk for a todo
[ ] for a task (defaulting to now today)
- something longer 
Http://someurl.com

Ideally if

‘- something longer’
Could be added as a note in an event I would be delighted
Like wise urls and all the other good things like /calendar and /repeats etc too.

Is this feasible with the above hack or am I barking in vain in the wrong forest?

Love this action. Thanks for creating it.

I’m having an issue where the default reminder time is not being set if I don’t add a date.

Also is it possible for the script to interpret “in 10 minutes?”

Update: I think I naively assumed that if I didn’t add any reference to a day or date or time the script would set the reminder to today at 12pm. But I have to add a day and then the alarm gets set for the default time of 12.

Howdy, I’m having an issue with this action where it works on the Mac, but not on iOS. This is the error I’m seeing:

Script Error: TypeError: undefined is not an object (evaluating listRegex.exec(workingString)

[1].trim()')

Line number: 30, Column 77

I tried removing the line that @agiletortoise removed on the similar event action, but unfortunately that didn’t work for me in this instance. I tried a bit of ChatGPT troubleshooting, but unfortunately I’m not a programmer.

Have you otherwise altered this action? The code for the action linked above does not even contain the string listRegex.exec(workingString) that seems to be throwing an error in your version.

Did a bit more testing and wanted to make sure I was running a clean unmodified version of this draft: Fantastically Good Reminder Parser | Drafts Directory

Turns out when running the draft on my Mac or an iPad it seems to work as expected. But when running it from my iPhone, I get the script error I shared above.

I find the same thing - the action works on an iPad but not on an iPhone.

The line throwing the error occurs in the third script

“const listString = listStringExists ? listRegex.exec(workingString)[1].trim() : “”;”

I just downloaded and tested this action on both iOS and Mac with a few different example drafts and had no issues.

I think, most likely, the issue is specific to certain content in the draft triggering a problem in the parser. Could you try to pin it down to specific texts? If not, could you provide details on the versions of the OS and Drafts you are running, and example draft text that trigger this error?

“Test Reminder Tomorrow 16:49”
“Test Reminder Tomorrow”
“Test Reminder 25/10/24”

const locale = “GB”;
All execute on iPad running IOS 18.0.1 with Drafts 45.1(518)

All fail on iPhone running IOS 18.0.1 with Drafts 45.1(518)

Can you give examples of Drafts that work on a phone, please?

Ian

OK, I see what the problem is…you did not give Drafts permission to access Reminders on your iPhone. Go to iOS Settings > Apps > Drafts and allow the app to use Reminders.

2 Likes

Perfect, thank you.

Ian

that did it for me too. Thanks so much.