#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=TX.ico #AutoIt3Wrapper_Outfile_x64=TX.exe #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;=============================================================================== ; Trekker extension with only 1 function - Extract all pdf pages to Notepad ; (Coded in Autoit) ; ; To use this extension: ; ; 1) Trekker must be viewing a pdf with no Text Viewer window. ; 2) Start this program (If not already started). Icon for it will be on task bar. ; 3) Left or right click the task bar icon. ; 4) Left click "Extract all pdf pages to Notepad". ; ; ; ICO from here -> https://findicons.com/icon/180638/user_male_white_red_brown ;=============================================================================== #include #include _Singleton(@ScriptName, 0) Opt('WinTitleMatchMode', 2) Opt('TrayMenuMode', 1) Opt('TrayOnEventMode', 1) TrayCreateItem('Trekker Extensions') TrayItemSetState(-1, $TRAY_DISABLE) TrayCreateItem('') TrayItemSetState(-1, $TRAY_DISABLE) $XTitem = TrayCreateItem('Extract all pdf pages to Notepad') TrayItemSetOnEvent(-1, 'XTevent') TrayCreateItem('Exit') TrayItemSetOnEvent(-1, 'ExitEvent') TraySetToolTip('Trekker Extensions') Opt('WinWaitDelay', 10) Sleep(2147483647) ;------------------------------------------------------------------------------- ; Extract all pdf pages to Notepad Func XTevent() ;--------------------------------------------------------------------------- ; After determining Trekker viewing pdf with no Text Viewer window, ; open Notepad to receive text and set focus for first page TrayItemSetState($XTitem, $TRAY_UNCHECKED) If Not StringInStr(WinGetTitle('Trekker'), '.pdf') Then Return If WinExists('Text Viewer - ') Then Return Run('Notepad') $handlet = WinActivate('Trekker') WinWaitActive($handlet) Send('{F8}') Send('{HOME}') $lasttitle = ' ' ;--------------------------------------------------------------------------- ; Loop thru pages, copying text to Notepad While 1 Send('{F2}') Send('T') $handlex = WinWait('Text Viewer - ', '', 5) WinActivate($handlex) WinWaitActive($handlex) $title = WinGetTitle($handlex) If $title = $lasttitle then Send('!{F4}') WinActivate('Untitled - Notepad') Return EndIf Send('^c') Send('!{F4}') $lasttitle = $title WinActivate('Untitled - Notepad') WinWaitActive('Untitled - Notepad') Send('^v') WinActivate($handlet) WinWaitActive($handlet) Send('{DOWN}') WEnd EndFunc ;------------------------------------------------------------------------------- ; Shut down this extension Func ExitEvent() Exit EndFunc