Action

OpenRef

Posted by @sylumer, Last update almost 7 years ago - Unlisted

Steps

  • script

    //Settings
    const RID_SEPARATOR = "_";
    
    //Load the draft and position the cursor to the start of the unique ID
    function openReference()
    {
    	//Get the arguments we're picking out of the transient draft
    	let strArgs = draft.content.split(RID_SEPARATOR);
    	
    	//Prep the draft we want to work on
    	draftOriginal = Draft.find(strArgs[0]);
    	
    	//Get the postion of the unique position ID
    	let intStartPos = draftOriginal.content.indexOf(draft.content);
    
    	//Open the real draft and position the cursor at the start of the ID
    	editor.load(draftOriginal);
    	editor.setSelectedRange(intStartPos, 0);
    	editor.activate();
    }
    
    openReference();
    
    

Options

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