![]() ![]() I guess it may not be a good indicator for recompling LaTeX documents. RE: the refresh symbol - it is a bit shy and I cannot find it every time when the PDF document is refreshed. Note, the “flash” action is implemented in a makeshift manner: when a Sumatra window changes its title text by removing the "" bit, the window is minimized first, and “activated” 20 milliseconds after. Credits: the monitor-title-change structure. See the "ugly gray box" workaround below for a less distracting implementation. Caveat here: this will interrupt an "active typing session", buy shifting the "focus" to the Sumatra window. Sleep 20 Tune this number (in milliseconds) for a "slower flash" upon completion of the compiler. Lastly, this is the "flashing" piece: hide the window for a few msgbox, Stored the active window ID it is: %ActiveSumatraID% Check that ActiveSumatraID should be unique. WinGet, ActiveSumatraID, ID, ahk_exe SumatraPDF.exe Log for the current window ID, as ActiveSumatraID Note, WinExist helps to look for all existing Sumatra windows. Only to flash when a window no longer has "" Here, only consider flashing things when "" is found in title If (Title TitleLast) and InStr(TitleLast, "") WinGetTitle, Title, ahk_exe SumatraPDF.exe SetTimer, CheckChanged, 250 Check every quarter-second WinGetTitle, TitleLast, ahk_exe SumatraPDF.exe The main loop, in AHK, things before the first "return" is called: auto-execution section the output PDF when compilation completes. When compiling tex files locally with latexmk as an "auto-compiler", flash To install Autohotkey, please use this installer (link pointing to the official website). It is meant to be first saved as a text file called something.ahk and executed through Autoohtkey. (If such a window is not at the forefront, the window will be activated to show on top of other windows.) It “flashes” the Sumatra window with a newly compiled PDF file as long as such Sumatra window exists. ![]() Here is a simple AutoHotKey script that “flashes” the newly compiled PDF document when is removed from the Sumatra window’s title text. Which could be combined with Making SumatraPDF accept /A page=numbers from Zotero - #8 by llinfeng If you think that too prone to affecting LaTeX or its editor, more simply if the LaTeX editor call is CLI (Not DDE) write an ahk script in place of SumatraPDF.exe that throws up the msg as it passes the same arguments through to the real SumatraPDF SO if the trigger is recompile calling why not just on demand hook that event? very easy to inject a “shim” that gets the call in place of Pdflatex.exe etc and passes the call through to Pdflatex with a Tee (Y branch) to flag up the event in a msgbox. I concluded that it is possible to monitor top LEFT title for change of first character to [ but reducing polling time would eat up CPU resources My other question was:- How long is the refresh symbol active? A quick one page cycle may be missed by the polling time of the watcher… It certainly can fill the screen in black if you so desire, but you could need to replace the message acknowledge button with a timeoutīiggest problems with one pixel monitoring was:- The target symbol is not fixed UNLESS you are working full-screen and the page is NOT zoomed away from the margins I tried PixelNotifier – Skrommel's One Hour Software to see if it could be a basis to work from, but it raised more questions than answers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |