Note Reminder Plugin

Name

Note Reminder

Description

Create tasks to review a note in a certain number of days

Icon

add_alert

Instructions


This plugin allows you to easily create a Task to review the current note in a certain number of days. It will add the Task to Note chosen in the prompt (defaulting to the one from the settings, if set) and set the Start Date for the Task to be a set number of days in the future.

After installation, to use, select Note Reminder from the Note menu in the upper right corner of the note.
This will prompt for the Note to add the Task to (will default to the one from the settings if none is chosen) and the number of the days in the future for the Start Date.

If no Default Days is set the plugin will currently default to 7 days.

Known Issues
- Task content Note links are not converted to an actual link but can easily be made one by clicking on it
- Note for Task field in prompt is not populated with the Default Task Note as value doesn't work for note types

Setting

Default Days

Setting

Task Note

linkVersion History

1.0.0

Initial public release

1.0.1

Link to review note in task is now an actual link

{
// --------------------------------------------------------------------------------------
constants: {
version: "1.0.1"
},
 
// --------------------------------------------------------------------------
// https://www.amplenote.com/help/developing_amplenote_plugins#noteOption
noteOption: async function(app) {
const defaultTaskNoteName = app.settings["Task Note"];
const daysUntilStart = app.settings["Default Days"] || "7";
const reviewNote = await app.findNote({ uuid: app.context.noteUUID });
const defaultNoteMessage = (defaultTaskNoteName) ? ` (Default: ${defaultTaskNoteName})` : "";
const result = await app.prompt(
"Please choose a note for task and number of days",
{inputs: [
{ label: `Note for Task${defaultNoteMessage}`, type: "note" },
{ label: "Days to wait (integer)", type: "text", value: daysUntilStart }
]}
);
if (result) {
const [ note, days ] = result;
const taskNote = note || await app.findNote({ name: defaultTaskNoteName });
if (!taskNote) {
app.alert("You must select a task note or have a default specified in the settings");
return
}
const daysToWait = Number(days);
if (days.indexOf('.') > -1 || isNaN(daysToWait)) {
app.alert("You must enter a valid integer for Days to wait");
return
}
await app.insertTask(
{ uuid: taskNote.uuid },
{
content: `Review [${reviewNote.name}](https://www.amplenote.com/notes/${reviewNote.uuid})`,
startAt: this._addDaysAndGetSeconds(new Date(), daysToWait)
}
);
};
},
 
// --------------------------------------------------------------------------
_addDaysAndGetSeconds(date, days) {
return this._convertEpochMillisecondsToSeconds(this._addDays(date, days))
},
 
_addDays(date, days) {
var startDate = new Date(date);
startDate.setDate(startDate.getDate() + days);
return startDate;
},
 
_convertEpochMillisecondsToSeconds(date) {
return Math.floor(date.getTime() / 1000)
},
}