Jump to content

Recommended Posts

Posted

Hi everyone, I'm new to the Autoit scene and I'm looking for some guidance. I'm saving emails from thunderbird to file and would to know how I can get Autoit to find the Subject line and copy that as well as the email message that's between 2 lines of text. The email message is below some static text that never changes if this helps someone with an idea on how I can do this. Or if you think i'd be better off using some other tool, please let me know thank you.  Below is a partial of the email. Thanks in advance.

Subject: New text message from (000) 000-0000               <-----------------------(I WOULD LIKE TO COPY THIS LINE AFTER SUBJECT:
From: "(000) 000-000" <xxxxxxxxxxxxxxxxx@txt.voice.google.com>
To: xxxxxxxxxx@gmail.com
Content-Type: multipart/alternative; boundary="000000000000ee478545554554"

--000000000000ee478545554554
Content-Type: text/plain; charset="UTF-8"; format=flowed; delsp=yes


<https://voice.google.com>                  <------------------------------(BELOW THIS LINE I WOULD LIKE TO COPY THE EMAIL MESSAGE ONLY AND STOP BEFORE IT GETS TO "YOUR ACCOUNT"
This shirt features one of the main characters Pencilmiss from
Pencilmation! Pencilmation is a cartoon channel for kids and
not-too-serious grown-ups. It is made with love and a lot of fun by an
international team helmed by Ross Bollinger who started the channel alone
in his room a long time ago. Follow the new, wacky, and often times quite
silly adventures of Pencilmate, Little Blue Man, Pencilmiss and other toons
every Tuesday, Thursday and Saturday on our Youtube Channel "Pencilmation".
YOUR ACCOUNT <https://voice.google.com> HELP CENTER                         <---------------------------STOPPING BEFORE IT GETS TO THIS LINE

 

Posted

I've tried this code

#include <MsgBoxConstants.au3>

$txt = FileRead("FILENAME") ; text of the mail
Msgbox(0,"Before", $txt)

$m1 = "Subject: "
$m2 = "<https://voice.google.com>"
$m3 = "YOUR ACCOUNT"

$res = StringRegExpReplace($txt, '(?s).*' & $m1 & '(\N+\R).*?' & $m2 & '(.*?)' & $m3 & '.*', "$1$2")
Msgbox(0,"After", $res)

Func Example()
    ; Retrieve the window text of the active window.
    Local $sText = WinGetText("[ACTIVE]")

    ; Display the window text.
    MsgBox($MB_SYSTEMMODAL, "", $sText)
EndFunc   ;==>Example

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...