Action

Load Temp Workspace

Posted by agiletortoise, Last update almost 6 years ago

Demonstrates using script to create and apply a temporary workspace that is not saved in the Workspaces list. Handy for ad-hoc filtering of draft list based on tags or a query string that you might not use often enough to want to add as an workspace - or which might be based on prompts or other inputs that vary.

Steps

  • script

    // BEGIN config variables
    // setup tags or searches you wish to load...
    let name = "Blue Things";
    let tagFilter = "blue, !green"
    let queryString = "";
    // END config variables
    
    // create workspace
    // for other options, see:
    // https://reference.getdrafts.com/objects/Workspace.html
    let ws = Workspace.create();
    ws.name = name;
    ws.tagFilter = tagFilter;
    ws.queryString = queryString;
    ws.setInboxSort("modified", true);
    
    // unless you call `ws.update()`, this ws is temporary
    // load this workspace, and display draft list
    
    app.applyWorkspace(ws);
    app.showDraftList();

Options

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