Advertisement
SeeYouAtTOP

Autohotkey Extract Mail ID from Gmail

Nov 28th, 2020
556
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. StringCaseSense, off
  2. f1::
  3. ;-----------grab info from email-----------
  4. Send ^a
  5. Sleep, 200
  6. Send ^c
  7. Sleep, 500
  8. ;-----------check if owe money-----------
  9. firstmail :=
  10. mails :=
  11. varfrom := Clipboard
  12.  
  13. Pos_Found:=RegExMatch(varfrom,"i)(?:[\w_+\.-]+)@(?:[\w\.-]+)\.(?:[a-z\.]{2,6})",mail,1)
  14. mails.=mail "`n"
  15. firstmail := SubStr(mails,1,InStr(mails,"`n")-1)
  16.  
  17. StringReplace, firstmail, firstmail, From, , All ;Deletes "From" word from varfrom
  18. StringReplace, firstmail, firstmail, `r, , All ;;Deletes "`r" from varfrom
  19. FileRead, varowemoney, %A_ScriptDir%\NoAction.txt ;Defaulter = varowemoney
  20. firstmail=%firstmail% ; ;Deletes Extra spaces etc  from varfrom
  21. IfInString, varowemoney, %firstmail%
  22.  {
  23.  msgbox, This person owes money do not take order
  24.  Return
  25.  }
  26.  
  27. ;-----------check what dept this goes to-----------
  28. If clipboard Contains GST
  29.                                                  {
  30.                                                          Msgbox, This is for the GST Dept.
  31.                                                                                        
  32.                                                  }
  33.  
  34.  
  35. If clipboard Contains @ICAI
  36.                                                  {
  37.                                                      Send, l
  38.                                                      Sleep, 500
  39.                                                      Send, Dream CA
  40.                                                      Sleep, 500
  41.                                                      Send, {Enter}
  42.                                                  }
  43.  
  44.  
  45. If clipboard Contains goats
  46.                                              {
  47.                                                          If clipboard Contains %A_Space%KY%A_Space%
  48.                                                                                               {
  49.                                                                                               Msgbox, This is for the KY Animal dept.
  50.                                                                                               }
  51.                                                          If clipboard Contains %A_Space%DE%A_Space%
  52.                                                                                               {
  53.                                                                                               Msgbox, This is for the DE Animal dept.
  54.                                                                                               }
  55.                                              }
  56.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement