Insert Draft at Cursor

Posted by agiletortoise, Last update over 5 years ago

Prompt to select and existing draft, insert content of selected draft at the last cursor position (replacing selection).


  • 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 content
    	let [st, len] = editor.getSelectedRange();
    	editor.setSelectedRange(st+d.content.length, 0);
    	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.