[sane-devel] On Macintosh: Not finding Epson Scanner, try this.
Tom Myers
tomlists at itainc.com
Wed Nov 25 19:48:20 UTC 2015
If you can’t find an epson scanner when using scanimage -L you may want to run this short applescript that kills the Epson scanner process. Turns out it opens the scanner in exclusive access and doesn’t let it go.
A variant of this may work with other brand scanners also.
-- Kill any Epson monitor that is running in exclusive mode
try
set results to (do shell script "ps -xww | grep 'MacOS/EPSON Scanner'")
set AppleScript's text item delimiters to {return & linefeed, return, linefeed, character id 8233, character id 8232}
set results to text items of results
set AppleScript's text item delimiters to {""}
log (count of results)
set firstLine to item 1 of results
if ((count of results) > 2 and firstLine contains "MacOS/EPSON Scanner") then
set pid to word 1 of firstLine
set results1 to (do shell script "logger 'Forcing Epson Scanner to quit, PID: '" & pid)
set results2 to (do shell script ("kill " & pid))
else
set results3 to (do shell script ("logger 'Epson Scanner not running'"))
end if
end try
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20151125/37f22fbb/attachment.html>
More information about the sane-devel
mailing list