Jump to content

Recommended Posts

Posted (edited)

Hi everybody, I need information about automation process in Thunderbird.

Before I used 2 plugin Print Tool and FiltaQuilla

To remove email header and  send filtered email to print spooler

 

these plugins are incompatible with the latest version of thunderbird.

 

I would like to write a script to do this with autoit, could you tell me the most effective way to start?

THX 

Edited by rootx
Posted (edited)
7 hours ago, faustf said:

i think thunderbird  use sqlite , you can find  sqlite  db  attach  with autoit  and  extrapolate  what you want

thx,

1. Round

 i am looking at sqlite "global-messages-db.sqlite", profile.ini to find the exact user, and one query

select c0body,c1subject,c2attachmentNames,c3author,c4recipients from messagesText_content where c1subject = 'Test' AND c3author = "test@gmail.com"
_SQLite_Startup()
Local $hDB = _SQLite_Open(@ScriptDir&"\global-messages-db.sqlite")

Local $aRows, $iRows, $iCols
_SQLite_GetTable2d($hDB, "select c0body,c1subject,c2attachmentNames,c3author,c4recipients from messagesText_content where c1subject = 'Test' AND c3author = 'test@gmail.com';", $aRows, $iRows, $iCols)
;_ArrayDisplay($aRows)
for $x = 1 to UBound($aRows)-1
    ConsoleWrite($aRows[$x][0]&"-"&$aRows[$x][1]&"-"&$aRows[$x][2]&$aRows[$x][3]&"-"&$aRows[$x][4]&"-"&@CRLF)
    ;Run ( @ScriptDir & '\SumatraPDF.exe -print-to-default ........????
Next

_SQLite_Close($hDB)
_SQLite_Shutdown()

2. Round 

Use Windows Task Scheduler every 5 minutes

3. Round

Run UseSumatraPDF

PS: I need some clarification... 

Run ( @ScriptDir & '\SumatraPDF.exe -print-to-default ' & ...... from sqlite??

 

do you have a better method?

THX

Edited by rootx
Posted

when i run sqlite  return me blanck table  but  with navicat  software i open and i can see a data , therfore i think exist a bug in sqlite or  maybe  we do some  error

Posted

@faustf see your other thread.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Posted (edited)

Here my script

_SQLite_Startup()

Local $hDB = _SQLite_Open(@ScriptDir & "\global-messages-db.sqlite")

Local $aRows, $iRows, $iCols

_SQLite_GetTable2d($hDB, "select c0body,c1subject,c2attachmentNames,c3author,c4recipients from messagesText_content where c1subject = 'Test' AND c3author = 'test@gmail.com';", $aRows, $iRows, $iCols)

;_ArrayDisplay($aRows)

For $x = 1 To 1 ;UBound($aRows) - 1
    ;ConsoleWrite($aRows[$x][0]&"-"&$aRows[$x][1]&"-"&$aRows[$x][2]&$aRows[$x][3]&"-"&$aRows[$x][4]&"-"&@CRLF)
    $file = @ScriptDir & "\" & $x & ".txt"
    FileOpen($file, 2)
    FileWrite($file, $aRows[$x][0])
    FileClose($file)
    If FileExists($file) Then
        Run(@ScriptDir & '\SumatraPDF.exe -print-to-default ' & $file)
        Sleep(4000)
        WinWaitActive('[CLASS:#32770]')
        ControlSend('', '', '', $x)
        ControlSend('', '', '', '{ENTER}')
        WinClose("[CLASS:32770]")
    Else
        ConsoleWrite("error file not created " & $file & @CRLF)
    EndIf
Next

_SQLite_Close($hDB)
_SQLite_Shutdown()

Bye Bye 

Edited by rootx

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...