API Docs

A reminder from the Reminders app, as returned by hs.eventkit.incompleteReminders() and its relatives.

Each property is read from the underlying reminder when you access it. A reminder is a snapshot: if it changes in Reminders after you fetched it, fetch it again to see the change.

The properties are read-only; change a reminder with update(), which saves the change straight away, and delete it with remove().

Don't create these yourself; they come from hs.eventkit, and hs.eventkit.createReminder() makes new ones.

  • Example:
hs.eventkit.incompleteReminders().then(reminders => {
    reminders.filter(r => r.dueDate && r.dueDate < new Date())
             .forEach(r => console.log("Overdue: " + r.title))
})

Properties

id

string

The reminder's identifier on this Mac, which hs.eventkit.reminder() finds it by.

externalID

string

The identifier the server gives the reminder, which is the same on every device but isn't guaranteed to be unique.

url

string

The URL attached to the reminder.

dueDate

Date

When the reminder is due, or null if it has no due date. For a reminder that is due on a day rather than at a time (see isAllDay), this is the start of that day.

isAllDay

boolean

Whether the reminder is due on a day, rather than at a particular time. Always false for a reminder with no due date.

priority

string

The reminder's priority: "none", "low", "medium" or "high".

isCompleted

boolean

Whether the reminder has been completed.

completionDate

Date

When the reminder was completed, or null if it hasn't been.

alarmDates

Date[]

When the reminder's alerts go off. Only alerts at a set time are listed; Reminders can also have alerts for arriving at or leaving a place, which update() leaves alone.

A due date doesn't produce a notification by itself: add an alert for that.

listID

string

The identifier of the reminder's list, as in hs.eventkit.reminderLists().

listTitle

string

The title of the reminder's list.

Methods

update(changes) -> HSReminder

Changes some of the reminder's properties and saves the change.

The properties changes leaves out are left as they are.

If anything in changes is invalid, or the change can't be saved, this throws and the reminder is left as it was.

update(changes) -> HSReminder
Name Type Description
changes HSReminderChanges The properties to change
The reminder, for chaining
Throws an Error on failure; wrap calls in try/catch to handle it.
try {
    reminder.update({ isCompleted: true })
    reminder.update({ dueDate: new Date(Date.now() + 3600000), priority: "high" })
} catch (err) {
    console.error(err.message)
}

remove() -> boolean

Deletes the reminder.

The object keeps its properties afterwards, but it can't be updated or saved again.

remove() -> boolean
boolean
true once the reminder has been deleted
Throws an Error on failure; wrap calls in try/catch to handle it.
try {
    reminder.remove()
} catch (err) {
    console.error(err.message)
}

toJSON() -> object

Returns a plain object holding all of the reminder's properties, for JSON serialisation.

JSON.stringify() calls this automatically, so you rarely need to call it yourself.

toJSON() -> object
object
An object with every property of the reminder, with the values of its properties of the same names
Field Type Description
id string
externalID string | null
title string
notes string | null
url string | null
dueDate Date | null
isAllDay boolean
priority "none" | "low" | "medium" | "high"
isCompleted boolean
completionDate Date | null
alarmDates Date[]
isRecurring boolean
listID string | null
listTitle string | null
creationDate Date | null
lastModifiedDate Date | null
hs.eventkit.incompleteReminders().then(r => console.log(JSON.stringify(r, null, 2)))