Action

Markdown to Notes

Posted by agiletortoise, Last update about 4 years ago

Create a new note in Apple Notes converting the Markdown in Drafts to HTML.

Action uses AppleScript and is only compatible with Mac.

Steps

  • script (macOS only)

    let method = "execute";
    let script = `on execute(bodyHTML)
    	tell application "Notes"
    		activate
    		tell account "iCloud"
    			make new note at folder "Testing" with properties {body:bodyHTML}
    		end tell
    	end tell
    end execute`;
    
    let html = draft.processTemplate(`<html>
    <head>
    <style>
    body { font-size: 15pt; }
    </style>
    </head>
    <body>
    %%[[draft]]%%
    </body>
    </html>`);
    
    let runner = AppleScript.create(script);
    if (runner.execute(method, [html])) {
    	//
    }
    else {
    	alert(runner.lastError);
    }
  • prompt (iOS only)

    promptKey
    prompt
    promptTitle
    iOS not supported
    promptMessage
    This action uses AppleScript and can only be used in the Mac version of Drafts.
    promptButtons
    OK
    includeTextField
    false
    textFieldDefault
    includeCancelButton
    true

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.