Many new applications (I’m using Pro Tools) can run under Rosetta or Native Apple silicon by opening the get info window and checking or unchecking the “open using Rosetta” selection.
I would like to write an AppleScript to make the selection and then open the app – I go back and forth many times an hour.
This simple script opens the window:
tell application "Finder"
open information window of application file "Pro Tools.app" of folder "Applications" of startup disk
end tell
But I can’t seem to make the “open using Rosetta” selection.
I won’t guarantee this to work on your system without some adjustment – I’m still using Mojave – nevertheless it should be close.
Change the BBEdit path to Pro Tools.
Change the button name appropriately.
I’m using the “Locked” button as an example.
Once working correctly you can comment-out the activate line and let it work in the backbround.
I’d think it’d be possible to directly launch an app into Rosetta via script without having to monkey with the switch, but not being able to test I won’t even bet a beer on it.
-Chris
set appPath to "/Applications/Applications_Chris/Text_Editors/BBEdit/BBEdit.app"
set appRef to appPath as «class furl»
tell application "Finder"
activate
open information window of application file appRef
end tell
tell application "System Events"
tell application process "Finder"
tell front window
tell scroll area 1
tell checkbox "Locked"
perform action "AXPress"
end tell
end tell
end tell
end tell
end tell
its setUsingRosetta:true withAppName:"Pro Tools.app"
on setUsingRosetta:boolValue withAppName:appName
tell application "Finder"
set theInfo to open information window of application file appName of folder "Applications" of startup disk
end tell
-- Set using rosetta to true/false
its openUsingRosetta(boolValue)
-- Close information window
tell theInfo to close
end setUsingRosetta:withAppName:
on openUsingRosetta(boolValue)
tell application "System Events"
tell application process "Finder"
tell front window
tell scroll area 1
if value of checkbox 1 is not boolValue as integer then
click checkbox 1
end if
end tell
end tell
end tell
end tell
end openUsingRosetta