Solved

create e-mail with apple script - I'm looking for a very simple command

Posted on 2011-02-28
4
662 Views
Last Modified: 2012-06-27
Hello!

I need a very simple AppleScript that just creates an e-mail. The command needs to be systemwide and not be dependent on the application Mail being open. I just need a new e-mail window.

I have tried various variations of the shell command
do shell script "mail"

Open in new window


But I always get an error message that one of the characters is missing.

The Windows equivalent of this command is “mailto:". This will always open a new e-mail in the default mail application.

 your help is greatly appreciated!
0
Comment
Question by:speechrec
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 12

Accepted Solution

by:
xmlmagician earned 250 total points
ID: 34995717
try this one
tell application "Mail"
			set theNewMessage to make new outgoing message with properties {subject:"Subject text", content:"Content text", visible:true}
			tell theNewMessage
				make new to recipient at end of to recipients with properties {address:"email address"}
				send
			end tell
		end tell

Open in new window

0
 

Author Comment

by:speechrec
ID: 34995840
I know that one, but I don't want any recipient, subject line or content.
Just a naked email.
The kind of e-mail I want

okay,
I've figured it out, partly at least:
tell application "Mail"
	set theMessage to make new outgoing message with properties {visible:true}
end tell

Open in new window


It opens in the background. Is there a way to make it the topmost window?
0
 

Assisted Solution

by:speechrec
speechrec earned 0 total points
ID: 34995927
Okay, I've got it.

tell application "Mail"
	set theMessage to make new outgoing message with properties {visible:true}
end tell
-- Mail in den Vordergrund bringen!
tell application "Finder"
	try
		set frontmost of process "Mail" to true
	end try
end tell

Open in new window


I'll give you some of the points. Thanks for your help!
0
 

Author Closing Comment

by:speechrec
ID: 35042255
I had to figure it out myself. But it was no big deal.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Time machine backup 4 46
Safari Won't Go Full Screen 7 199
Mac OS X Server cant overwrite old files 7 58
Does Mac Word 2016 have collapsable regions? 8 75
Apple's Mac OS X has become an official member of the malware club. The Flashback Trojan has affected over half million Macs, worldwide. It is behavior that ultimately gets malware onto a person’s computer. Obsolete or out-of-date software helps…
Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question