 |
 |
AppleScript Mail Script
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Aug 2002
Location: Portland, OR
Status:
Offline
|
|
My brother in law comes over to my house during the day while I'm at work to visit with our puppy and use my computer. This is great because my wife and I are teachers and work 10+ hrs every day unless I need to let my dog out. We've asked him to e-mail us work when he comes over, but he "forgets".
So, I want an applescript that will run when he logs into my computer to send me an automated e-mail. I've tinkered a bit, but not gotten anything to work. Anybody have such a script or have some good advice on how to write one?
I am a very novice applescripter. Very novice.
BRS
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Oct 2001
Location: London
Status:
Offline
|
|
Code:
tell application "Mail"
(* SPECIFY GENERAL CONTENT OF MESSAGE *)
set bodyvar to return & return & "Test body."
set addrVar to "bogus@apple.com"
set addrNameVar to "Guinea Pig"
(* DEFINE THE SUBJECT LINE *)
set subjectvar to "Test Message From AppleScript!"
(* CREATE THE MESSAGE *)
set composeMessage to (a reference to (make new outgoing message at beginning of outgoing messages))
tell composeMessage
make new to recipient at beginning of to recipients ¬
with properties {address:addrVar, name:addrNameVar}
set the subject to subjectvar
set the content to bodyvar
end tell
(* SEND THE MESSAGE *)
send composeMessage
end tell
|
|
|
| |
|
|
|
 |
|
 |
|
Moderator Emeritus 
Join Date: Mar 2001
Location: Austin, MN, USA
Status:
Offline
|
|
Diggory's script will open Mail and send an e-mail. You need to save it as an application and put it in his login items if you want it to send every time he logs in. Just FYI, because it opens Mail, it is not transparent to the user. This shouldn't matter in your situation though since he knows he's supposed to send the mail, he just forgets. This way he doesn't have to remember. But there are ways to send the mail without him even knowing it. It requires an extra AppleScript scripting addition or a command line solution.
(Last edited by Xeo; Dec 5, 2003 at 12:42 PM.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Aug 2002
Location: Portland, OR
Status:
Offline
|
|
Do you know a transparent version too? It appears as though he defeated the script yesterday - not sure why... When I test it, it works every time (i.e., whenever I log in as him, it sends off an e-mail to my work address. But, yesterday, it didn't work (and I know he logged in).
Thanks again,
BRS
Originally posted by Xeo:
Diggory's script will open Mail and send an e-mail. You need to save it as an application and put it in his login items if you want it to send every time he logs in. Just FYI, because it opens Mail, it is not transparent to the user. This shouldn't matter in your situation though since he knows he's supposed to send the mail, he just forgets. This way he doesn't have to remember. But there are ways to send the mail without him even knowing it. It requires an extra AppleScript scripting addition or a command line solution.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|