Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Jetheat

macrumors regular
Original poster
Mar 13, 2008
247
2
I managed to create an application in Automator that will send out a new mail message.

But how do I use this where I can highlight any email address on the web, right-click and choose my Automator application, and then have that send my message to that email which I highlighted?

Also, how do I get my application to show in the services menu?

Appreciate the help,

JH
 
Thanks for that.
I have done that now, but how do I select an email address on the net (linked or unlinked), and have that populated in the TO field of my email when I run the script? - See attached image.

Is there a way to call the script from the right-click menu?

JH


Screenshot 2023-04-22 at 16.13.57.png
 
Your selection is wrong. Not "in Mail", choose the app you are getting the email address from or choose "any" for the service to be available in all apps.
 
Ok, I changed that to "Any application" and now, if I highlight an email address on the net and right click and choose my quick action, it opens up the Mail Compose window with my text as expected, but the email address which I highlighted is pasted at the bottom of that email message rather than in the TO field.

How do I get the email to paste itself in the TO field?

JH
 
Use AppleScript:
Code:
on run {input, parameters}
    set theRecipient to input
    tell application "Mail"
        set theMessage to make new outgoing message with properties {visible:true, subject:"My Subject"}
        tell theMessage
            make new to recipient at end of to recipients with properties {address:theRecipient}
        end tell
        activate
    end tell
end run
That's great, how do I enter a message in that code, and how do I set my outgoing email address?

JH
 
Replace in the code below:
"Subject of the email" with your desired subject
"myEmail@adress.com" with your email adress used for sendind the message
"content of the email" with the text content of the email

Code:
on run {input, parameters}
    set theRecipient to input
    set theSubject to "Subject of the email"
    set theSender to "myEmail@adress.com"
    set theContent to "content of the email"
    tell application "Mail"
        set theMessage to make new outgoing message with properties {visible:true, sender:theSender, subject:theSubject, content:theContent}
        tell theMessage
            make new to recipient at end of to recipients with properties {address:theRecipient}
        end tell
        activate
    end tell
end run
 
  • Like
Reactions: Jetheat
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.