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.
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.
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?
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.
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 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?
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.