Drafts Action Directory

Show List

Posted by @FlohGro, Last update 3 months ago

Query für Drafts with [your List tag]
Opens a prompt with your current lists
Opens the List with you selected

Install

Steps

  • script

    //show list
    // tag to assign to list drafts (set your own)
    const listTag = "ref_list";
    const linkListTitle = "Links";
    
    var res;
    {
    let ws = Workspace.create();
    ws.tagFilter = listTag;
    ws.tagFilterRequireAll = true;
    res = ws.query("all");
    }
    // sort array in alphabetical order
    res.sort((a,b) => (a.title.toUpperCase() > b.title.toUpperCase()) ? 1:-1);
    
    var p = Prompt.create();
    
    for(i in res)
    {
    	p.addButton(res[i].title,res[i].uuid);
    }
    
    
    
    var didSelect = p.show();
    if (didSelect == 1) {
    	var selecteduuid = p.buttonPressed;
    	var selectedDraft = Draft.find((selecteduuid));
    	editor.load(selectedDraft);
    	if (selectedDraft.title == linkListTitle) {
    		editor.linkModeEnabled = true;
    	}
    }
    
    

Options

  • After Success Default
    Notification Info
    Log Level Info

Comments

Actions available in the Action Directory are uploaded by community members. Use appropriate caution reviewing downloaded actions before use.