A Script For When Your Duplexing Scanner is Broken

I do a lot of scanning.  I’ve got a whole lot more to do.   Efficiency is getting to be important.  Starting years ago with a cheap flatbed and not a lot of disk (when my scans were terrible,) I’ve come some distance, owning a few decent scanners with high-speed ADFs and duplexing ability.  But there’s a thing about duplexers – they’re often broken.  Not just offline, unusable, smoking and shooting gears all over, but subtly broken in ways you won’t discover until page 305 of the last existing copy of your document resembles a toilet paper roll after the cat’s been at it.  Or they just jam.  Psuedo-jam, showing no apparent problem with the paper or the rollers or the little gnomes inside that flip the paper over.  They’re just feeling moody and have decided that tonight, you’re better off with NetFlix and the cat.

So you write that feature off – the ADF still works in simplex mode, right?  Usually they do.  So you scan one side of your stack and then the other side.  If you’re using a directly-connected scanner and a program like Acrobat, you’ve got the benefit of a duplexing mode that will take care of collating and ordering the pages to mirror the original document.  If you’re scanning directly to a stack of image files, either because you’re using a network scanner that can only do that, you want to massage the images before sticking them into Acrobat or you’re just using a different set of tools altogether, you’ll need to rename the two sets of files (“front” and “back,” aka “odd” and “even”) into one sequential set to feed in proper order into your favorite PDF-maker.

That’s where I was tonight, so I’ve written a VBscript to do the job.  IrfanView has a batch mode which will do this but I found setup too tedious and too easy (for me) to make mistakes.  This problem has surely been solved many times over but my google searches for extant examples were in vain tonight (mainly hindered by the number of “(web)page scanning scripts” out there.)  I make no claims at any talent for scripting, whether in VBscript or any other tongue, but I’ve got something that does the job.  If you can use it – or better yet, modify it for your needs – have at it:

‘ scanfix.vbs
‘ 01/28/2014 chiclassiccomp.org
‘ Takes two sets of image files scanned as front and back pages and arranges them in order for import into Acrobat
‘ Assume that the back pages were scanned in reverse order (flipping over the stack without re-ordering)
‘ Instructions: create three directories “odd,” “even” and “final.”  Put odd (front) and even (back) pages in appropriate directory.
‘ Output is copied to “final.”  Files are assumed to be using the TIF extension.  Change the two “oname = ” lines if you’re using a different extension.

Set objFSO = CreateObject(“Scripting.FileSystemObject”)
OddFolder = “odd”
EvenFolder = “even”
FinalFolder = “final”
ocount = 0
ecount = 0

‘ Count odd files
Set objFolder = objFSO.GetFolder(OddFolder)
Set colFiles = objFolder.Files
For Each objFile in colFiles
    ocount=ocount+1
Next
wscript.Echo “There are ” & ocount & ” odd files”

‘ Count even files
Set objFolder = objFSO.GetFolder(EvenFolder)
Set colFiles = objFolder.Files
For Each objFile in colFiles
    ecount=ecount+1
Next
wscript.Echo “There are ” & ecount & ” even files”

‘ Make sure they match
if ocount = ecount then
    wscript.Echo “File counts match.  Proceeding with copy and rename…”
else
    wscript.Echo “File counts don’t match!”
    wscript.quit
end if

‘ Copy odd files to final dir and rename them properly
set objFolder = objFSO.GetFolder(OddFolder)
set colFiles = objFolder.Files
set filesys=CreateObject(“Scripting.FilesystemObject”)
fcount=1
For Each objFile in colFiles
    oname = “finalfinal” & fcount & “.tif”
    filesys.copyfile objfile,oname
‘    wscript.echo objfile & ” ” & oname
    fcount = fcount + 2
Next

‘ Copy even files to final dir and rename them properly
set objFolder = objFSO.GetFolder(EvenFolder)
set colFiles = objFolder.Files
set filesys=CreateObject(“Scripting.FilesystemObject”)
fcount=ocount*2
For Each objFile in colFiles
    oname = “finalfinal” & fcount & “.tif”
    filesys.copyfile objfile,oname
‘    wscript.echo objfile & ” ” & oname
    fcount = fcount – 2
Next

* Some things I (or you!) may want to add:
   – Padding the final filenames with leading zeroes to ensure proper ordering (so file10 doesn’t come before file2, etc.)
   – Checking for the odd/even/final directories and making them if they’re not there.  There’s no reason for the user to have to do this.

That damned Google+ Picasa redirect

Hey Google – when I send someone a Picasa album or pic link, where do you think I want them to go?  Answer: Not Google+

This can be fixed by adding a “noredirect=1” argument to the URL but placement matters:

This works:

https://picasaweb.google.com/102190732096693814506/DropBox?noredirect=1#5822348278420254786

This doesn’t:

https://picasaweb.google.com/102190732096693814506/DropBox#5822348278420254786?noredirect=1

This concludes our lesson.

Lotsa Balls

The correct name, of course, is IBM Selectric Typing Element. I’ve got a good pile and finally got around to inventorying them.

Link
I was hoping there was a complete guide out there for IBM elements but I haven’t found it (sounds like another project.) I did find some scans of a brochure from GP, who also made elements for the Selectric line. I compiled them into a PDF for the docs site.

AHA-2940 Under Windows 7

What’s the most popular PC SCSI card of all time? 1541C? Maybe. Or it may be the AHA-2940 family. It’s up there, anyhow. And what card did Microsoft (and Adaptec) drop support for in Windows 7? The AHA-2940. Fortunately, I found a workaround which appears to succeed:

http://social.technet.microsoft.com/Forums/en/winserverfiles/thread/bf0bb207-3b5d-489d-be74-56031dfe4651

Basement Electronics Lab of Dqqm, v.91b

Today’s upgrade is the home-made equipment rack. My first project involving my new table saw. No fingers were lost in this operation:

From the bottom:

– Micronta DVM

– Tektronix 466 ‘scope

– A pair of low-amperage, noisy PSUs (will be replacing as soon as I can pick out a decent one)

– China-brand frequency detector

– Micro-Seven PBX emulator

And in the front is a Heathkit analog/digital lab/trainer.

Google Books and Magazines

Here’s an interesting note…Google Books has a whole lot of magazines up now. One of them is Info World. I’ve had it come up in a lot of searches for old tech products and the articles have been very helpful. If you browse their Info World selection, the furthest you can go back is 12/22/86:

http://books.google.com/books/serial/ISSN:01996649?rview=1&lr=&sa=N&start=960

However, most of the articles that have popped up in searches have been from the early 80s – prime time for oddball hardware and non-standard systems. So where are those issues? Well, let’s tweak that URL:

http://books.google.com/books/serial/ISSN:01996649?rview=1&lr=&sa=N&start=1300

Looks like they now start at 12/11/78 – big difference!

They’re still indexed by Google yet are not browseable. Intentional or just a bug in their catalog? I dunno.