The original address: blog.scottkleper.com/scanline-co…

Blog.scottkleper.com/

Release date: October 9, 2013

I scanned almost everything — bills, old photos, mortgage documents, tax documents, etc. It can be tedious, but it makes finding things a lot easier when you need to remember whether you filed an 83(b) election in 2006, or exactly what roof condition the previous owner disclosed.

Having a good scanner and file feeder helps a lot, but Mac OS X’s standard scan user interface isn’t entirely effective for quickly scanning a bunch of things into labeled directories. What I really wanted was a way I could type something quickly on the command line to control the scanner, but I couldn’t find anything there. So I wrote Scanline, which I now offer as an MIT-licensed open source project.

Using scanline

The basic way to use scanline is to call it from the command line with no arguments (press the up arrow if you’ve just scanned for something before).

airica:~ klep$ scanline
Copy the code

This will scan the current file in the paper feeder of the default scanner into ~/Documents/Archive/[year]/scan_[HMS].pdf.

Scanline uses directories as labels, so if the file you want to scan is your car registration, you can specify scanline to place it in the “car “directory.

airica:~ klep$ scanline car
Copy the code

This will place the files in ~/Documents/Archive/ CAR /[year]/scan_[HMS].pdf.

If you also want your registration to show up in your catalog for tax purposes (so you remember to deduct VLF), you can specify multiple labels.

airica:~ klep$ scanline car taxes
Copy the code

It will be in ~ / Documents/Archive/taxes / [year] / scan_ [r]. HMS alias create a scan in PDF file, and directory of the original car.

If the document is double-sided (and your scanner supports it), use -Duplex to scan both sides.

airica:~ klep$ scanline -duplex car taxes
Copy the code

Want to scan from a flatbed scanner instead of a document feeder?

airica:~ klep$ scanline -flatbed
Copy the code

Want to scan to a different root directory instead of ~/Documents/Archive?

airica:~ klep$ scanline -dir ~/Desktop
Copy the code

Here’s a good example — have a lot of items to scan on a tablet, but want to put them all together as a PDF?

airica:~ klep$ scanline -batch -flatbed
Copy the code

Want to give a file a name that isn’t universal?

airica:~ klep$ scanline -flatbed -name registration car
Copy the code

The above command will scan the items on the tablet to ~/Documents/Archive/car/[year]/registration.pdf.

If you have multiple scanners connected to your computer, you can select them by name.

airica:~ klep$ scanline -scanner "Epson 565655"
Copy the code

If you’re not sure what scanners are available, list them.

airica:~ klep$ scanline -list
Copy the code

For scanline

If you want to build Scanline from source, enhance it, or adapt it to your needs, get it here.

Github.com/klep/scanli…

If you only want binaries (this is a debug version, but fast and stable enough for practical use), you can download it here.

How does it work

Scanline is created using the ImageCaptureCore framework. It uses Lumberjack for recording and XCTest/OCMock for unit testing. This is my first Mac app in quite some time, so please go easy on me if you look at the source code.


Translation via www.DeepL.com/Translator (free version)