Action

On This Date…

Posted by @nahumck, Last update over 2 years ago - Unlisted

Create a temporary workspace from drafts created on this date (mm-dd) and tagged journal, and load them into view.

Steps

  • script

    // BEGIN config variables
    // setup tags or searches you wish to load...
    let name = "On This Date";
    let tagFilter = "journal"
    const now = new Date()
    const date = now.toString("MM-dd")
    let queryString = date;
    let group = ActionGroup.find("Journal");
    app.loadActionGroup(group);
    let lTheme = Theme.find("custom", "Journal Light");
    let dTheme = Theme.find("custom", "Journal Dark");
    // 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("created", true);
    ws.loadFolder = "all";
    ws.showPreview = false;
    ws.showTags = false;
    ws.showLastAction = false;
    ws.showDate = false;
    ws.loadActionBarGroup = group;
    ws.loadActionListGroup = group;
    //ws.lightTheme = lTheme;
    //ws.darkTheme = dTheme;
    
    // unless you call `ws.update()`, this ws is temporary
    // load this workspace, and display draft list
    app.applyWorkspace(ws);
    app.showDraftList();
    
    // set the Journal themes
    app.lightTheme = lTheme;
    app.darkTheme = dTheme;
    

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.