mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-13 20:28:21 +10:00
gui_main.py: add error handling for unaccelerated AppleScript
This commit is contained in:
@@ -1194,13 +1194,16 @@ class wx_python_gui:
|
||||
if answer == wx.ID_YES:
|
||||
output =subprocess.run(
|
||||
[
|
||||
"osascript", "-e",
|
||||
'tell app "System Preferences" to reveal anchor "General" of pane id "com.apple.preference.security"',
|
||||
"-e", 'tell app "System Preferences" to activate',
|
||||
"osascript", "-e",
|
||||
'tell app "System Preferences" to activate',
|
||||
"-e", 'tell app "System Preferences" to reveal anchor "General" of pane id "com.apple.preference.security"',
|
||||
],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE
|
||||
)
|
||||
if output.returncode != 0:
|
||||
# Some form of fallback if unaccelerated state errors out
|
||||
subprocess.run(["open", "-a", "System Preferences"])
|
||||
time.sleep(5)
|
||||
self.OnCloseFrame(None)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user