Task Wizard (Beta)

name

Task Wizard (Beta)

description

Adds inline tags to tasks with consistency & ease!

instructions


Run the Task Wizard inside a task by calling it with ` {Task Wizard} ` or as a Note Option to create new tasks!

This plugin will add the entries or leave blank lines in a preformatted layout.

=0=0=0=0=0=0=0=0=0=0=

** Setup **

The Status, Area, and Energy fields use Notes in specified Tags to function. The Active Marker is also a note.

First, indicate the tags for Status, Area, and Energy in the Plugin Settings.

For example,
- Tag with Statuses = atlas/status
- Tag with Areas = atlas/area
- Tag with Energy = action/energy

Then, type the name of the Active Marker note.
For example,
- Active Marker = ⭐

Now, the plugin is ready to modify existing tasks! Simply run {Task Wizard} inside a task and use the window to append multiple inline tags at once!

=0=0=0=0=0=0=0=0=0=0=

The Default Task Destination is for the Note Option - running the plugin from the 3 dot menu inside a note.

If a default Note Destination is not specified in the Plugin Settings and a note is not selected when the plugin runs, then a task will not be made (it has no where to put the task!)

Set the Default Task Destination in the Plugin Settings by typing the name of the desired note.
For example,
- Default Task Destination = Task Inbox


==0=0=0=0=0=0=0=0=0=0=

Tips:
- Make sure note titles are unique so the plugin (or you) don't get confused!
For example, if there are multiple notes named "Task Inbox", it'll go to the one that was made first.

- Use words or emojis that inspire you! This plugin runs on notes that you made, so title them in ways that keep you motivated 💨

- Stay consistent - Using a reliable system to keep track of what's going on in our lives will help us perform at our best!

==0=0=0=0=0=0=0=0=0=0=

Features
-
Modify Existing Tasks
- Create New Tasks to a Default Destination
- Uniform task formatting for consistent visibility

Fields

- Active Task Marker
- Energy Level
- Status
- Area
- Additional Details

=0=0=0=0=0=0=0=0=0=0=

Roadmap

Creating batches of tasks under the same project

With indicators for the number of tasks in the batch

(Task 1 of 3)

Setting

Default Task Destination

Setting

Tag with Statuses

Setting

Tag with Areas

Setting

Tag with Energy

Setting

Active Marker



linkVersion History

0.1

Creates single tasks

0.2

Adds info to existing tasks

Note Option is still v1

0.2.1

Started upgrading Note Option

Updated Instructions for clarity



{
async insertText(app) {
const taskUUID = app.context.taskUUID;
if (!taskUUID) {
app.alert("Please run the Task Wizard in a task.");
return
};
 
// Fetch the Original Task Content
const taskContent = await app.getTask(taskUUID);
// console.log("taskContent:", taskContent); // debug
let originalTask = taskContent.content;
originalTask = originalTask.split("{");
// console.log("originalTask:", originalTask); // debug
 
 
// Fetch the Status Options from the tag declared in Settings
const statusTag = await app.filterNotes({ tag: app.settings["Tag with Statuses"] });
// Convert the note handles to a format suitable for the dropdown menu
const statusOptions = statusTag.map(statusTag => ({
label: statusTag.name, // display the note title in the dropdown menu
value: statusTag.uuid // return the note UUID when the option is selected
}));
// console.log("statusOptions:", statusOptions); // debug
 
const areaTag = await app.filterNotes({ tag: app.settings["Tag with Areas"] });
const areaOptions = areaTag.map(areaTag => ({
label: areaTag.name,
value: areaTag.uuid
}));
// console.log("areaOptions:", areaOptions); // debug
 
const energyTag = await app.filterNotes({ tag: app.settings["Tag with Energy"] });
if(!energyTag) {
app.prompt("Please select the tag with Energy Levels in the Settings.");
return;
}
const energyOptions = energyTag.map(energyTag => ({
label: energyTag.name, // display the note title in the dropdown menu
value: energyTag.uuid // return the note UUID when the option is selected
}));
// console.log("energyOptions:", energyOptions); // debug
 
 
const activeMarker = app.settings["Active Marker"];
const activeNote = await app.findNote({ name: activeMarker});
const activeName = activeNote.name;
const activeUUID = activeNote.uuid;
// console.log("activeName:", activeName);
// console.log("activeUUID:", activeUUID);
 
const result = await app.prompt("Task Details", {
inputs: [
{ label: 'Active Task', type: "checkbox"},
{ label: 'Status', type: "select", options: statusOptions},
{ label: 'Area', type: "select", options: areaOptions},
{ label: 'Energy Level', type: "radio", options: energyOptions},
{ label: 'Additional Details', type: "text"},
]
});
// console.log("result:", result); //debug
 
 
if (result) {
const [ active, status, area, energy, details ] = result;
const taskStatusUUID = status;
const taskAreaUUID = area;
const taskEnergyUUID = energy;
const taskDetails = details;
 
const selectedStatus = statusOptions.find(option => option.value === status);
const taskStatus = selectedStatus ? selectedStatus.label : '';
// console.log("taskStatus:", taskStatus);
 
const selectedArea = areaOptions.find(option => option.value === area);
const taskArea = selectedArea ? selectedArea.label : '';
// console.log("taskArea:", taskArea);
 
const selectedEnergy = energyOptions.find(option => option.value === energy);
const taskEnergy = selectedEnergy ? selectedEnergy.label : '';
// console.log("tasEnergy:", taskEnergy);
 
const activeLink = `[${activeName}](https://www.amplenote.com/notes/${activeUUID})`;
// console.log("activeLink:", activeLink);
 
 
const ticket0 = `${originalTask[0]}
\n [${taskEnergy}](https://www.amplenote.com/notes/${taskEnergyUUID})
\n ~ [${taskStatus}](https://www.amplenote.com/notes/${taskStatusUUID})
\n _${taskDetails}_
\n [${taskArea}](https://www.amplenote.com/notes/${taskAreaUUID})
`;
console.log("ticket0:", ticket0); //debug
 
const ticket1 = `${originalTask[0]} ${activeLink}
\n [${taskEnergy}](https://www.amplenote.com/notes/${taskEnergyUUID})
\n ~ [${taskStatus}](https://www.amplenote.com/notes/${taskStatusUUID})
\n _${taskDetails}_
\n [${taskArea}](https://www.amplenote.com/notes/${taskAreaUUID})
`;
console.log("ticket1:", ticket1); //debug
 
if (active == true) {
await app.updateTask(taskUUID, { content: ticket1 });
 
return "";
};
 
if (active == false) {
await app.updateTask(taskUUID, { content: ticket0 });
 
return "";
};
};
},
 
 
noteOption: async function(app) {
// const defaultTaskProject = app.settings["Default Project"];
// const defaultTaskArea = app.settings["Default Area"];
const defaultDestination = app.settings["Default Task Destination"];
 
const areaTag = await app.filterNotes({ tag: app.settings["Tag with Areas"] });
const areaOptions = areaTag.map(areaTag => ({
label: areaTag.name,
value: areaTag.uuid
}));
// const defaultProjectMessage = (defaultTaskProject) ? ` (Default: ${defaultTaskProject})` : "";
// const defaultAreaMessage = (defaultTaskArea) ? ` (Default: ${defaultTaskArea})` : "";
 
 
const defaultDestinationMessage = (defaultDestination) ? ` (Default: ${defaultDestination})` : "";
 
const result = await app.prompt("Task Details", {
inputs: [
{ label: `Where is this project going?${defaultDestinationMessage}`, type: "note"},
{ label: `Project Name`, type: "text"},
{ label: 'Task', type: "text"},
{ label: 'Details', type: "text"},
{ label: 'Area', type: "select", options: areaOptions},
]
});
 
if (result) {
const [ destination, project, task, details, area ] = result;
const taskDestination = destination || await app.findNote({ name: defaultDestination});
if (!taskDestination){
app.alert("Please specify what note the task will be created in or have a default in the settings.");
return
}
const taskProject = project;
const taskName = task;
if (!taskName){
app.alert("Please create a Task Name.");
return
}
const taskDetails = details;
const taskAreaUUID = area;
const selectedArea = areaOptions.find(option => option.value === area);
const taskArea = selectedArea ? selectedArea.label : '';
 
const noteUUID = taskDestination.uuid;
 
const ticket = `~ ${taskProject} ~ \n . \n **${taskName}**\n _${taskDetails}_\n . \n [${taskArea}](https://www.amplenote.com/notes/${taskAreaUUID})`;
 
await app.insertTask(
{uuid: noteUUID },
{content: ticket}
);
};
},
}