0

So I have an apple script that sends an email via the mail app. I didn't make it myself though.

tell application "Mail"
    set newMessage to make new outgoing message with properties {subject:mailSubject, visible:true}
    tell newMessage
        set content to mailContent
        set visible to true
    end tell
    activate
end tell

Now I would like to change the script to, instead of opening the Mail app directly, just open a mailto: link with whatever client is configured for that.

Is that possible?

  • This sounds like an XY Problem, so let me suggest that you use Default Apps and on the URL's tab, scroll down to mailto and set the Default Application: to whichever Mail Client you want mailto: links to open in. Then there should be no need for an AppleScript, unless you're not presenting the whole story in your question. – user3439894 Apr 21 '16 at 13:46
1

Whatever opens MAILTO:// links is set from within the Mail.app itself Go to Mail > Preferences > General and the top pop-up menu lets you set any installed application that the OS recognizes as being able to respond to those links as the default email application.

There used to be hacks that let a web browser with a webmail client open respond to mailto links but I haven't used one of them in years so not sure if/how that would work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .