Guest User

Untitled

a guest
Dec 14th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. --choose way
  2. set switch to display dialog "Which way do you want to use?" buttons {"Messages", "Mail"} default button "Mail"
  3.  
  4. set choice to button returned of switch
  5.  
  6.  
  7. --send message
  8. if choice is "Message" then
  9. set temp to display dialog "What do you want to tell your girlfriend" default answer ""
  10.  
  11. set content to text returned of temp
  12.  
  13. tell application "Messages"
  14. set receiver to buddy "your girlfriend's name in your Contact"
  15. send content to receiver
  16. end tell
  17. end if
  18.  
  19.  
  20. --send mail
  21. if choice is "Mail" then
  22. set mailbox to display dialog "Which mailbox do you want to use?" buttons {"mailbox1", "mailbox2"} default button "mailbox1"
  23. set mailbox to button returned of mailbox
  24. if mailbox is "mailbox1" then
  25. set theSender to "xxx@xxx"
  26. end if
  27. if mailbox is "mailbox2" then
  28. set theSender to "xxx@xxx"
  29. end if
  30.  
  31. tell application "Mail"
  32.  
  33. set inputContent to display dialog "what do you want to say to your girlfriend?" default answer ""
  34.  
  35. set theSubject to "Missing you" -- the subject
  36. set theContent to text returned of inputContent -- the content
  37. set theAddress to "your girlfriend's email address" -- the receiver
  38.  
  39. set msg to make new outgoing message with properties {sender:theSender, subject:theSubject, content:theContent}
  40.  
  41. tell msg to make new to recipient at end of every to recipient with properties {address:theAddress, name:"sweetie"}
  42.  
  43. send msg
  44. end tell
  45. end if
Add Comment
Please, Sign In to add comment