Workspace Builder

Posted by Jake B, Last update 13 days ago - Unlisted

Though still a WIP, this Action allows you to build up a temporary Workspace that will load immediately. There is an option to save the Workspace permanently as well.


  • script

    // See online documentation for examples
    // Temporary Workspace Constructor for Building on-the-fly workspaces
    // should provide various checkboxes and stuff in a prompt. 
    // It works! Now to iterate. Tags should be have some select boxes too. 
    // Create option to save the workspace and add some more choices to the prompt around various WS variables!
    let coreTags = ["work", "notes", "call", "meeting", "draft", "reference"];
    let selectableTags = Array.from(new Set(coreTags));
    let initialTags = [];
    // Prompt for Workspace Variables
    var p = Prompt.create();
    p.title = "Create Workspace";
    p.addTextField("name", "Title", "");
    p.addSwitch("tagswitch", "Require All?", false);
    p.addSwitch("saveit", "Save Workspace?", false);
    p.addTextField("tagfilter","CS-Tags", "");
    p.addTextField("queryString", "Query?", "");
    p.addSelect("tags", "Tags for Filter", selectableTags, initialTags, true);
    p.addButton("Load Workspace");
    // var con =;
    // unless you call `ws.update()`, this ws is temporary
    // load this workspace, and display draft list
    if ( {
    	let ws = Workspace.create(); = p.fieldValues["name"];
    	ws.tagFilter = p.fieldValues["tagfilter"]+","+p.fieldValues["tags"].join(",");
    	ws.queryString = p.fieldValues["queryString"];
    	ws.setInboxSort("modified", true);
    	ws.loadFolder = "all";
    	//  save for later, need to incorporate into tagFilter somehow, probably build up an array and then split it again.
    	if (p.fieldValues["tagswitch"]==true) {
    		ws.tagFilterRequireAll = true;
    		else if (p.fieldValues["tagswitch"]==false) {
    			ws.tagFilterRequireAll = false;
    if (p.fieldValues["saveit"]==true) { 
    app.displayInfoMessage("Workspace created using " + p.fieldValues["tagfilter"]+","+p.fieldValues["tags"].join(",") + " as tag filter.");
    // 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:


  • 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.