Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set myReply to "Thanks, I've received your email. If I have any questions about it I will contact you directly"
- tell application "Mail"
- set theSelection to selection
- if theSelection is {} then return
- activate
- repeat with thisMessage in theSelection
- set theOutgoingMessage to reply thisMessage with opening window
- repeat until exists (window 1 whose name = "Re: " & subject of thisMessage)
- end repeat
- delay 0.1
- -- send gui scripting to handler to get it out of Mail tell block
- my guiScriptMail(myReply)
- send theOutgoingMessage -- This automatically sends the message!
- end repeat
- end tell
- on guiScriptMail(myReply)
- tell application "System Events"
- tell process "Mail"
- set frontmost to true
- -- keystroke "a" using {command down} -- ⌘A to select all
- keystroke myReply
- end tell
- end tell
- end guiScriptMail
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement