Every time my scan VM logs on I get the dialog on the right.
Every time I finish an OCR scan, I get the dialog below.
There are two reasons I want to close the ABBY dialog:
- While open, it will keep both the original PDF and OCR PDF files alive.When after a while, Windows updates auto-reboots the machine, before clicking the OK buttons I have to manually check if the conversion succeeded before removing the non-OCR PDF.This is time consuming.
- While open, it still consumes a lot of system resources: about 100 megabyte for a simple single monochrome A4 page. Much more for complex, multi-page or colour documents.When scanning a lot of document this causes the system to run out of memory, after becoming much much slower because the truckload of Window handles and underlying threads drags Windows down.
I do not want to fully get rid of these dialogs, as often being aware of the progress is important, and I always forget how to re-enable things. If you can do without the dialogs, then try these:
- [WayBack] How to Turn Off the Pop Up Feature in ScanSnap Manager – ScanSnapWorld
- [WayBack] How to Disable ScanSnap Pop-ups
Finding the Windows and controls
I did use one nice feature of AutoHotKey: their Windows Spy utility, which is implemented as a AHK script: [WayBack] AutoHotKey-scripts/WindowSpy.ahk at master · elig0n/AutoHotKey-scripts · GitHub. In the past this was a separate executable, so do not start looking for that any more. You can get it either after a full install of the [WayBack] Releases · Lexikos/AutoHotkey_L · GitHub, or by extracting from the most current AutoHotKey.zip from [Archive.is] AutoHotkey Downloads.
Related:
- [WayBack] Changes & New Features | AutoHotkey
1.1.27.00 – December 25, 2017
Changes:
Replaced AU3_Spy.exe with WindowSpy.ahk.
…
- [WayBack] autohotkey – What is AU3_Spy.exe? Where can I find it? – Stack Overflow
- Search for
Spy
in
This gets these for the Create Cloud and ABBY windows:
Automating the click
I contemplated about using AutoIt (freeware, but closed source) or AutoHotKey_L (the current active fork of AutoHotKey).
AutoIt is now closed source, forked in the past as AutoHotKey, which has a lot of half backed – usually poorly documented – scripts needing you to learn a new API wrapper around existing Windows API functionality.
So I reverted back to using the Windows API using Delphi: a simple repeat
loop, to check for the existence of the underlying processes, windows and controls, plus some logic to terminate then the user stops the application (Ctrl-C, Ctrl-Break), logs off, or Windows shuts down.
Releated Windows API keywords and posts:
- Terminating in time:
SetConsoleCtrlHandler
andHandlerRoutine
parameterdwCtrlType
valuesCTRL_C_EVENT
,CTRL_BREAK_EVENT
,CTRL_CLOSE_EVENT
,CTRL_LOGOFF_EVENT
andCTRL_SHUTDOWN_EVENT
.- Remember that the
HandlerRoutine
is called in a separate thread, implying you should be very careful with what you do. Best is to only set some flags. Worst is to go GUI handling (DO NOT CALLShowMessage
HERE!)
- Remember that the
- Delphi related:
- [WayBack] SetConsoleCtrlHandler Verständnisfrage(n)
- [WayBack] How do I handle Ctrl+C in a Delphi console application? – Stack Overflow
- [WayBack] Embarcadero Discussion Forums: Using ‘SetConsoleCtrlHandler’ to …
- [WayBack] Detect Windows Shutdown – delphi
- [WayBack] problem: SetConsoleCtrlHandler – delphi
- [WayBack] Handling the OS shutdown event using WinAPI describes the
SetConsoleCtrlHandler
for console applications, the service relatedRegisterServiceCtrlHandler
andRegisterServiceCtrlHandlerEx
calls and the Windows messages to watch for GUI applications:WM_QUERYENDSESSION
andWM_POWERBROADCAST
.
- Checking for processes, windows and controls:
I could have used AutoHotKey with these hints to get it working:
- [Archive.is/WayBack] ControlClick – Syntax & Usage | AutoHotkey: The ControlClick command sends a mouse button or mouse wheel event to a control.
- [WayBack] AutoHotkey Webinar- Various ways to use AHK to automate tasks in Windows (videos below the fold)
- [Archive.is/WayBack] OnExit() – Syntax & Usage | AutoHotkey: The OnExit function specifies a callback function or subroutine to run automatically when the script exits.
- [WayBack] AutoHotKey: Introduction
- [WayBack] Repeating things
- [WayBack] Category:AutoHotkey – Rosetta Code
- [WayBack] Wait for window to open then use WinGetTitle. – Ask for Help – AutoHotkey Community
- [WayBack] Wait for a window to finish loading – AutoHotkey Community
- [WayBack] How to wait for a window to appear – Ask for Help – AutoHotkey Community
- [Archive.is/WayBack] Process – Syntax & Usage | AutoHotkey
- [WayBack] AutoHotKey script to automatically close a window when it opens – Super User
- [WayBack] Waiting for a button – Ask for Help – AutoHotkey Community
- [WayBack] wait till window opens then wait till it closes – Ask for Help – AutoHotkey Community
- [WayBack] windows – AutoHotKey – ellegant way of waiting until a system dialog box becomes able to accept keystrokes? – Super User
- [WayBack] I want to create an AutoHotKey script that waits for a window and sends some keystrokes to it, but the keystrokes are repeating by default – Super User
MacOS
Note that when you run on MacOS, you need an alternative like for instance the video below shows via [WayBack] Stop ScanSnap From Prompting You When You Scan.
–jeroen