Action

Send to MarsEdit

Posted by agiletortoise, Last update 28 days ago

Launch MarsEdit, create a new document using the first line of your draft as the title and the remaining text as the body.

Note: This action is Mac-only and requires MarsEdit be installed

Steps

  • script (macOS only)

    let title = draft.processTemplate("[[title]]");
    let body = draft.processTemplate("[[body]]");
    
    let method = "sendToMarsEdit";
    let script = `on sendToMarsEdit(theTitle, theContent)
    	tell application "MarsEdit"
    		activate
    		make new document
    		tell document 1
    			set title to theTitle
    			set body to theContent
    		end tell
    	end tell
    end sendToMarsEdit
    `;
    
    let runner = AppleScript.create(script);
    if (!runner.execute(method, [title, body])) {
    	console.log(runner.lastError);
    	context.fail();
    }
  • prompt (iOS only)

    promptKey
    prompt
    promptTitle
    iOS not supported
    promptMessage
    This action requires AppleScript and is only compatible with the Mac version of Drafts.
    promptButtons
    OK
    includeTextField
    false
    textFieldDefault
    includeCancelButton
    true

Options

  • After Success Default , Tags: debug
    Notification Info
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.