Focus on linked excerpts

Posted by jsamlarose, Last update over 1 year ago

Creates a new temp workspace that focuses on drafts that share the same title. Useful if you save multiple text excerpts from a single article or blog post as separate drafts. By default, the action captures the text section of the first markdown link in the current draft (retaining square brackets) and searches for other drafts that also contain the same text string.

Makes use of Greg’s “Load temp workspace” sample code, and works best with a share extension template that captures the title and url along with any text you’ve selected in Safari (or wherever you’re using the share extension to capture text).


  • script

    // See online documentation for examples
    // Use this if you're sure the title will always be a url
    var myTitle = /\[(.*?)\]/.exec(editor.getText())
    // Use this if you're happy to work with the title (first line) regardless of whether it's a link or not...
    // var myTitle = draft.title
    // alert(myTitle)
    // BEGIN config variables
    // setup tags or searches you wish to load...
    let name = myTitle[0];
    let tagFilter = ""
    let queryString = myTitle[0];
    // END config variables
    // create workspace
    // for other options, see:
    let ws = Workspace.create(); = name;
    ws.tagFilter = tagFilter;
    ws.queryString = queryString;
    ws.setInboxSort("created", false);
    // unless you call `ws.update()`, this ws is temporary
    // load this workspace, and display draft list


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