New Note Link Wizard (Plugin)

name

New Note Link Wizard

description

Makes a link that creates a new note from the current note.

instructions


Provide (optional) Name or Tags and the plugin will generate a link that creates a new note by using the current note as a template with the provided name and/or tags.

*** Please Be Mindful that a tag must already exist for the plugin to create notes with it! ***

Check out this demo video for an in-depth tutorial!

setting

Note Template

{
async noteOption(app) {
const noteID = app.context.noteUUID;
 
const result = await app.prompt("New Note Details", {
inputs: [
{ label: 'Name', type: "string"},
{ label: 'Tags', type: "tags"},
]
});
 
function encodeName(nameInput) {
return encodeURIComponent(nameInput);
}
 
if (result) {
const [theName, theTags] = result;
const noteName = theName;
const noteTags = theTags;
 
const nameInput = noteName;
const encodedName = encodeName(nameInput);
 
// Corrected logical AND operator
if(!noteName && !noteTags){
app.alert(`https://www.amplenote.com/notes/new?source=${noteID}`);
}
else if(!noteName){
app.alert(`https://www.amplenote.com/notes/new?source=${noteID}&tags=${noteTags}`);
}
else if(!noteTags){
app.alert(`https://www.amplenote.com/notes/new?source=${noteID}&name=${encodedName}`);
} else {
app.alert(`https://www.amplenote.com/notes/new?source=${noteID}&name=${encodedName}&tags=${noteTags}`);
}
}
}
}