Jump to content

Simple workflow to create a new email with hotkey


Recommended Posts

Nice! Instead of a hotkey, I rather set the keyword "email", with optional argument. That way I can still look for a recipient in my address book, but in case he's not registered, your workflow open the blank email. Super efficient!

Link to comment
  • 3 years later...

Sorry to resurrect this old post, but does anyone have this workflow or an alternative that does the same thing?

 

I made you one Workflow that creates a New Blank Mail here: https://www.dropbox.com/s/f9h4ewrhsbyqsiv/Create%20New%20Blank%20Mail.alfredworkflow?dl=0

Could change preferences for it, but i guess this is what you wanted.

 

In case the link would die, here is the Applescript:

tell application "Mail"
   make new outgoing message
end tell

To add preference it has to be like this:

tell application "Mail"
   make new outgoing message with properties {visible:true, subject:"My Subject", content:"My Body"}
end tell

Found it here: http://www.mactech.com/articles/mactech/Vol.21/21.09/ScriptingMail/index.html

 

If you want you could also do this with a query to define directly your Subject, Content etc.

 

Hope this helps you :)

Edited by FroZen_X
Link to comment

If Mail.app isn't your thing, this should work with whatever you have set as your default client:

tell application "System Events" to open location "mailto:"

Definitely works with Mail.app, Outlook, Airmail 2, MailMate. Does not work with Mail Pilot.

Link to comment
on alfred_script(q)
  	tell application "Mail"
   		make new outgoing message
	end tell
end alfred_script

 

Generally, it's a better idea to ignore the Run NSAppleScript Action and use the normal Run Script Action with language = /usr/bin/osascript (AS) instead.

 

The reason is that Alfred blocks while a Run NSAppleScript is running, so you can't use Alfred, but a Run Script is always run in the background.

Edited by deanishe
Link to comment

 

Generally, it's a better idea to ignore the Run NSAppleScript Action and use the normal Run Script Action with language = /usr/bin/osascript (AS) instead.

 

The reason is that Alfred blocks while a Run NSAppleScript is running, so you can't use Alfred, but a Run Script is always run in the background.

 

I didn't know that, so thanks for pointing that out :) I changed the workflow and uploaded it again.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...