我在 python 文件中有以下代码:
applescript.run('''
tell application "System Events"
-- one second delay
delay 1
-- to press command+shift+g
keystroke "G" using {command down, shift down}
delay 2
-- to enter file path
keystroke "/Users/***/Documents/web_images/image_1.jpg"
delay 1
-- hit return twice
keystroke return
delay 1
keystroke return
end tell
''')
在我安装 Monterey 之前它工作得很好,现在它不再工作了。有人知道如何解决吗?