I have a script that runs a unix executable, and I want the script to decide which executable to choose, depending on whether it’s running under Apple Silicon or Intel.
On my borrowed Apple Silicon machine, I enter in the terminal
uname -m and get the result
So, using SD7 on an Apple Silicon machine, I enter
set thisArch to do shell script "uname -m" display dialog thisArch
and get the result
x86_64. If I save this as an applet, and open it in the Big Sur Script Editor, I get the same result, but if I then export that script from the Big Sur Script Editor, and run it, it gives the result
My app that runs the unix executable can’t be edited in the Script Editor (too much stuff in the Contents folder, maybe), so I tried copying its main.scpt in to the Big Sur editor and exporting it, and then copying the exported script back into the app - but that continues to give x86_64 as the architecture, perhaps because the original droplet was made in that architecture.
Is there a better way to detect which architecture the current machine really is? Or should I wait until SD 8 arrives? (I’ve requested beta access.)