Jump to content
James

How do you send a new message in mail via applescript with a high priority?

Recommended Posts

Hi all,

 

Is it possible to set a mail message to high priority via an applescript? I've googled a bit and I've read that it's not possible.

 

Background: I have a old iSight hooked up to my mac and a motion detecting program running. When it detects motion I want it to email me (I'd also like to look at using messages once it's out of beta to send an sms via applesript but that can wait till Mountain Lion comes out) using mail and set the message to high priority. I can get it to send an email message using the script below but would like to set the priority to high.

 

Or should I look at creating an automator script and do it that way (if that makes sense).

 

Any help or suggestions would be greatly appreciated.

 

James.

 

 

tell application "Mail"

set theNewMessage to make new outgoing message with properties {subject:"Motion detected at home!!", content:"there is a url here", visible:true}

tell theNewMessage

make new to recipient at end of to recipients with properties {address:"blah@blah.com"}

send

end tell

end tell

Edited by James

Share this post


Link to post
Share on other sites

You might be better off by setting a rule on the receiving end of the equation (in your Mail client or on the mail server (Gmail for example)). So that when you get a message in your inbox that has the subject 'Motion detected at home!!' your mail service can mark the message as high priority for you.

Share this post


Link to post
Share on other sites

If you take a look at the Mail dictionary in the AppleScript Editor it appears that the outgoing message only has elements for setting the recipient headers.

 

20120708-87qphi3ih5ae89wmxx97bnja3t.preview.jpg

Click for large view - Uploaded with Skitch

 

At first glance, to me, it appears you can't set any additional elements. You might try contacting Ben Waldie at http://www.automatedworkflows.com/ to see if he knows a workaround.

Share this post


Link to post
Share on other sites

make a rule in Mail on the recieving Mac that looks like this. the SMS Applescript is a script that sends an SMS message using iChat to your phone number.

 

motiondetected.png

 

 

tell application "iChat"

activate

send "Motion Detected" to account "+15551234" of service 1

end tell

Edited by johnfoster

Share this post


Link to post
Share on other sites

Hi All,

 

I resorted to marking the emails high priority when I receive them at work.

 

The alarm app (Witness by Orbicule if anyone is interested) sends a message to my mobile device (a work provided iPhone). But due to work turning off the data part of the plan, I only get the messages when I'm in range of a wireless network I have access to- *pout*. I'll look into the sms applescript after Mountain Lion comes out because I may get a personal iPhone (but much later in the year) after iOS 6 comes out.

 

Thanks for the suggestions.

 

CYa!

James.

Share this post


Link to post
Share on other sites

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

  • Recently Browsing

    No registered users viewing this page.

  • Who's Online (See full list)

    There are no registered users currently online

×