Action

Links to this draft (title)

Posted by @jsamlarose, Last update almost 4 years ago - Unlisted

Basically filters an existing (named) workspace to display drafts that contain references the current draft’s title. If you’re using Drafts’ wiki link syntax for linking between documents, it’s essentially a way to display all drafts that link to the current draft.

Opens a new window when run. Current draft gets pushed into a window on the right, filtered workspace on the left, so you can review linked drafts while keeping your original starting point at hand. I still find this a little disorientating— I’d prefer the current draft to remain active on the left, with the filtered list on the right, but I’m not sure if it’s possible to script that yet.

Steps

  • script

    // See online documentation for examples
    // https://docs.getdrafts.com/docs/actions/scripting
    
    // global search
    
    let ws = Workspace.find("everything");
    ws.queryString = "\""+draft.displayTitle+"\""
    ws.loadFolder = "all"
    
    app.openInNewWindow(draft);
    app.applyWorkspace(ws);
    
    app.showDraftList();
    
    

Options

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