Action

Mail.app <-> Airmail

Posted by taglia, Last update about 2 years ago

Converts a message URL from Mail.app (or Mailmate) to Airmail, and vice versa.

Steps

  • script

    // Cesare Tagliaferri 2022-04-11
    // Convert Airmail link to Mail.app and back
    
    let selection = editor.getSelectedText();
    
    if (selection.startsWith('message:')) {
    	selection = selection.replace(/message:\/\/%3[cC]/,'');
    	selection = selection.replace(/%3[eE]$/,'');
    	selection = 'airmail://message?messageid=' + selection;
    } else if (selection.includes('messageid=')) {
    	selection = selection.replace(/.*messageid=/,'');
    	selection = decodeURIComponent(selection);
    	selection = 'message://%3c'+selection+'%3e'
    } else {
    	alert('The input is neither an Airmail nor a Mail.app URL');
    }
    
    editor.setSelectedText(selection);

Options

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