Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-02-28
4
Medium Priority
?
673 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 1000 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

Plug and play, no additional software required!

The ATEN UE3310 USB3.1 Gen1 Extender Cable allows users to extend the distance between the computer and USB devices up to 10 m (33 ft). The UE3310 is a high-quality, cost-effective solution for professional environments such as hospitals, factories and business facilities.

Question has a verified solution.

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

A common question or need, when setting-up a new Mac for someone would be to make all of the applications, installed, available from the dock. Many people often do not realize an application is installed unless it is in the dock. Creating a custo…
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 …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

705 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