Cross link drafts

Posted by @jsamlarose, Last update over 4 years ago

Prompt to select an existing draft, insert link to selected draft at the last cursor position and append link for current draft to selected draft

Slight tweak of Insert Draft at Cursor


  • script

    // select and existing draft
    // insert its content in the current draft
    // at the cursor position
    let f = () => {
    	// select an existing draft
    	let d = app.selectDraft();
    	if (!d) {
    		return false;
    	// insert link to target draft
    	let [st, len] = editor.getSelectedRange();
    	editor.setSelectedRange(st+4+d.title.length+d.permalink.length, 0);
    	// append link for current draft to target
    	d.content = d.content + "\n" + "["+draft.title+"]("+draft.permalink+")";
    	return true;	
    if (!f()) {


  • After Success Nothing
    Notification Error
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.