Action

Delete Proxy File

Posted by ernstwi, Last update about 2 years ago

Part of a workflow for editing drafts in an external editor (Mac only).

See GitHub README for details.

Steps

  • script

    function bash(script) {
        let sh = ShellScript.create(`#!/usr/bin/env bash\n${script}`);
        if (!sh.execute()) {
            throw new Error(sh.standardError);
        }
    }
    
    (function() {
        let bookmark = Bookmark.findOrCreate("proxy-files");
        let fm = FileManager.createForBookmark(bookmark);
        let file = `${fm.basePath}/${draft.uuid}.md`;
    
        try {
            bash(`rm ${file}`);
        } catch (e) {
            alert(e);
            return;
        }
    })();
    

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.