11.3 C
New York
Friday, May 1, 2026

bash – AppleScript Written on Intel iMac Runs Very Sluggish When MBA Exported As app on M2


Some years in the past Apple dropped help for my historic Canon Lide 30 scanner. So, I hung it off a Raspberry Pi (which nonetheless helps the scanner through scanimage) and wrote a quite simple Apple Script and an equally easy Bash Shell Script to make it work once more. The Apple Script ran on an Intel iMac and easily requested the person what measurement scan they wished (full web page, half web page, and many others.) The Apple Script then ran the Bash shell script which in flip 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 high quality on the Intel iMac.

Then I received an M2 MBA. I copied each the AppleScript and the Shell Script to the MBA. I exported the AppleScript from the Tahoe model of Script Editor (Model 2.11 (234)) as an app so it would not want Rosetta to run. After I “Get Information” on the app it’s a common app, however “Open Utilizing Rosetta” just isn’t checked.

It really works, however is extremely gradual and shows the dreaded SPOD on a regular basis that it’s working. I attempted taking a look at Exercise Monitor whereas it’s working and it’s consuming a really small quantity of CPU time (2%).

So, what extra info can I supply up to determine simply what I’ve executed flawed?

The script:

-- Wrapper for bash shell script which makes use of scanimage
-- Ask the person what measurement to scan
-- Full is an A4 sized scan
-- Half is half an A4
-- Quarter is the highest proper quadrant of the scanner mattress.

set mySize to select from listing {"Full", "Half", "Quarter", "Passport"} with immediate "Choose A4 scan measurement. Quarter is high proper"

-- Test to see if the person clicked the Cancel button.

if mySize is fake then
    -- The person clicked Cancel so show and confirming dialog and exit    
    show dialog "Canceled" buttons ("OK") default button "OK"
else
    -- The person made a range so name the shell script and append the chosen measurement to the decision
    do shell script "/Customers/mnewman/bin/a4scanpi.sh " & mySize
finish if

-- That is all of us

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Stay Connected

0FansLike
0FollowersFollow
0SubscribersSubscribe
- Advertisement -spot_img

Latest Articles