Action

Open Recent Drafts

Posted by Garbonsai, Last update about 2 years ago

Quickly switch between the last 10 most recently accessed drafts without changing workspaces, filters, etc.

Steps

  • script

    // 
    let f = () => {
    
    	// get a list of recent drafts
    	let recents = editor.recentDrafts;
    
    	// start building the prompt
    	let prompt = Prompt.create();
    	prompt.title = 'Recent Drafts';
    
    	// add buttons for each draft
    	for ( let recent of recents ) {
    		prompt.addButton( recent.displayTitle.substr( 0, 40 ), recent );
    	}
    
    	// display the prompt
    	if ( !prompt.show() ) return false;
    
    	// load the draft
        editor.load( prompt.buttonPressed );
    	return true;
    }
    
    if ( !f() ) context.cancel();

Options

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