1

Some years ago Apple dropped support for my ancient Canon Lide 30 scanner. So, I hung it off a Raspberry Pi (which still supports the scanner via scanimage) and wrote a very simple Apple Script and an equally simple Bash Shell Script to make it work again. The Apple Script ran on an Intel iMac and simply asked the user what size scan they wanted (full page, half page, etc.) The Apple Script then ran the Bash shell script which in turn ran a command on the Pi:

ssh pi@raspsky 'scanimage -x 210 -y 297 --resolution 300 > scan.ppm'

I exported the AppleScript from Script Editor as an app. This continues to work fine on the Intel iMac.

Then I got an M2 MBA. I copied both the AppleScript and the Shell Script to the MBA. I exported the AppleScript from the Tahoe version of Script Editor (Version 2.11 (234)) as an app so it wouldn't need Rosetta to run. When I "Get Info" on the app it is a universal app, but "Open Using Rosetta" is not checked.

It works, but is incredibly slow and displays the dreaded SPOD all the time that it is running. I tried looking at Activity Monitor while it is running and it is consuming a very small amount of CPU time (2%).

So, what additional information can I offer up to figure out just what I've done wrong?

The script:

-- Wrapper for bash shell script which uses scanimage
-- Ask the user what size to scan
-- Full is an A4 sized scan
-- Half is half an A4
-- Quarter is the top right quadrant of the scanner bed.

set mySize to choose from list {"Full", "Half", "Quarter", "Passport"} with prompt "Select A4 scan size. Quarter is top right"

-- Check to see if the user clicked the Cancel button.

if mySize is false then
    -- The user clicked Cancel so display and confirming dialog and exit    
    display dialog "Canceled" buttons ("OK") default button "OK"
else
    -- The user made a selection so call the shell script and append the selected size to the call
    do shell script "/Users/mnewman/bin/a4scanpi.sh " & mySize
end if

-- That's all folks
4
  • 2
    Can you add the shell script as well? If you run the shell script manually, is it fast? Commented yesterday
  • Comment: For 10 years or more there have been complaints that do shell script is slow. Guess: Tahoe makes this worse as macOS will be doing Gatekeeper, TCC, malware and other security checks every time it is run. Better (maybe): Do everything in shell script. Commented yesterday
  • 1
    I just tried on an M1 running Tahoe. Double-clicking the app immediately displays the list, selecting one entry equally fast executes the shell script via do shell script. Can you share some more details about which step is slow on your Mac? Commented 18 hours ago
  • Does the SPOD show before or after the prompt dialog? Commented 17 hours ago

1 Answer 1

4

This is not an answer to your question as it stands, rather a recommended solution for your underlying problem.

VueScan provides macOS support for nearly all scanners. Your particular scanner is included in the list. Connect your scanner to your iMac, install VueScan and run it.

You can download and run VueScan for free - but every scan will be watermarked. So once you have discovered that it works for your scanner, you will need to pay for VueScan. Though you may feel it is expensive, VueScan is cheaper than competitors like SilverFast. I bought the one-time professional edition many years ago and have never had to pay for upgrades. The standard edition is all you need.

3
  • Thank you, but I really like my method. It's free and it works. I also like that as soon as the scan is finished it is copied to whatever computer ran the app and opens the scan in Graphic Converter ready for any needed edits. The only thing that I don't like is that it seems slower on an Apple Silicon machine than on an Intel Mac. I assumed that was an error in my code, but I can't find that error. Commented yesterday
  • Fair enough. I hope you get it fixed. Commented yesterday
  • VueScan is amazing. Considering the mileage it gives you from any old scanner no longer supported with drivers it is cheap. I've got an allmost 30 year old A3 flatbed scanner who's latest official drivers are for Windows 95. With VueScan I still use it at least once a month to scan a comic book. (I collect vintage comics. The paper is often very fragile, so I make scans and turn those into CBRs to have a digital backup.) Commented 9 hours ago

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.