Tuesday, July 14, 2020

#1 2002-12-06 01:18:12 pm

Trash Man
Sanitation Department
Registered: 2005-10-20
Posts: 5336

Scripting in Mail app

:shock: Any examples of how to send mail via applescript to the mail app in osx and also moving messages from one folder to another with applescript?  Any help would be appreciated!  Thanks


One mans trash is another mans treasure

Offline

 

#2 2002-12-06 01:28:03 pm

T.J. Mahaffey
Administrator
From:: Arkansas, USA
Registered: 2002-11-20
Posts: 238
Website

Re: Scripting in Mail app

There's a good collection of Mail scripts here:
http://homepage.mac.com/aamann/Mail_Scripts.html

You can direct download them here (These are run-only):
http://homepage.mac.com/aamann/MailScripts.sit

And you can download them in source code form here:
http://homepage.mac.com/aamann/MailScripts.src.sit

There's bound to be something in there to get you started.  wink


T.J.
tj@tjmahaffey.com

Offline

 

#3 2002-12-06 02:11:48 pm

Rob
Member
From:: Ohio, USA
Registered: 2002-11-20
Posts: 1886

Re: Scripting in Mail app

:shock: Any examples of how to send mail via applescript to the mail app in osx and also moving messages from one folder to another with applescript?  Any help would be appreciated!  Thanks



To move messages from one folder to another requires changing a property of the message to be moved. This should move the selected message(s) to another folder (mailbox).

Applescript:

tell application "Mail"
   set selectedMessages to selection
   repeat with thisMess in selectedMessages
       set mailbox of thisMess to mailbox "Mom" -- A mailbox named "Mom"
   end repeat
end tell

As far as sending messages, have you checked the example scripts?  They should have been installed by default. A search for a folder named "Mail Scripts" should reveal several scripts. smile


Filed under: mail

Offline

 

#4 2002-12-07 05:52:57 pm

Trash Man
Sanitation Department
Registered: 2005-10-20
Posts: 5336

Re: Scripting in Mail app

Thanks Rob and TJ for your help... those scripts are trickier than usuall but they will work fine.  Thanks again! big_smile


One mans trash is another mans treasure

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)