Advertisement
Guest User

Untitled

a guest
Oct 21st, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. set idpassword to "supersecrets"
  2. set emaildomain to "domain.edu"
  3.  
  4. tell application "Microsoft Outlook.app"
  5.  
  6. set appleidmessages to (get every «class msg » in «class cMFo» "AppleVerify")
  7. repeat with messageid in appleidmessages
  8. set messagecontent to (get «class ctnt» of messageid)
  9. set parsedverifyurl to do shell script "echo " & (quoted form of messagecontent) & " | grep 'https://id.apple.com/cgi-bin/verify.cgi'"
  10. set parsedverifyurl to ((characters 10 thru -1 of parsedverifyurl) as string)
  11. set parsedverifyurl to ((characters 1 thru -67 of parsedverifyurl) as string)
  12. set appleid to do shell script "echo " & (quoted form of messagecontent) & " | grep '" & emaildomain & "'"
  13. set appleid to ((characters 1 thru 22 of appleid) as string)
  14.  
  15. tell application "Safari"
  16. open location parsedverifyurl
  17. activate
  18. delay 5
  19. do JavaScript "document.getElementsByName('appleId')[0].value='" & appleid & "'" in document 1
  20. do JavaScript "document.getElementsByName('accountPassword')[0].value='" & idpassword & "'" in document 1
  21. do JavaScript "document.forms['form1'].submit()" in document 1
  22. delay 5
  23. set verifyresults to do shell script "echo " & quoted form of (get source of document 1) & " | grep '" & emaildomain & "'"
  24. set verifyresults to ((characters -37 thru -1 of verifyresults) as string)
  25. if verifyresults is not equal to "is now associated with your Apple ID." then
  26. error number -128
  27. end if
  28.  
  29. close document 1
  30.  
  31. end tell
  32.  
  33. move messageid to «class cMFo» "AppleVerifyDone"
  34. end repeat
  35. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement