IvanV Posted May 21, 2022 Share Posted May 21, 2022 Hi guys. I'm on Monterey, running the script below (close notifications), Alfred 4 Accessibility access is allowed. Getting the "Alfred is not allowed assistive access". Why? on alfred_script(q) tell application "System Events" tell process "NotificationCenter" set theseWindows to every window whose subrole is "AXNotificationCenterAlert" or subrole is "AXNotificationCenterBanner" repeat with i from 1 to number of items in theseWindows set this_item to item i of theseWindows try click button 1 of this_item on error my alfred_script(q) end try end repeat end tell end tell end alfred_script Link to comment
vitor Posted May 22, 2022 Share Posted May 22, 2022 Welcome @IvanV, 13 hours ago, IvanV said: Getting the "Alfred is not allowed assistive access". Where? How is the warning being presented? If access is given but it’s not working remove the access then give it again, macOS sometimes needs that. Link to comment
IvanV Posted May 23, 2022 Author Share Posted May 23, 2022 On 5/22/2022 at 2:40 AM, vitor said: Welcome @IvanV, Where? How is the warning being presented? If access is given but it’s not working remove the access then give it again, macOS sometimes needs that. In the debug of the workflow. Tried to disable/re-enable access, no joy. The whole log: [10:12:26.468] Logging Started... [10:12:28.696] ClearALL[Keyword] Processing complete [10:12:28.698] ClearALL[Keyword] Passing output '' to Run NSAppleScript [10:12:28.895] ERROR: ClearALL[Run NSAppleScript] { NSAppleScriptErrorAppName = "System Events"; NSAppleScriptErrorBriefMessage = "Alfred is not allowed assistive access."; NSAppleScriptErrorMessage = "System Events got an error: Alfred is not allowed assistive access."; NSAppleScriptErrorNumber = "-25211"; NSAppleScriptErrorRange = "NSRange: {113, 100}"; } Link to comment
vitor Posted May 23, 2022 Share Posted May 23, 2022 (edited) Try replacing the Run NSAppleScript with a Run Script with /usr/bin/osasscript (AppleScript) as the language. Run NSAppleScript even suggests it, because it’s more reliable. Edited May 23, 2022 by vitor Link to comment
IvanV Posted May 26, 2022 Author Share Posted May 26, 2022 On 5/23/2022 at 2:36 PM, vitor said: Try replacing the Run NSAppleScript with a Run Script with /usr/bin/osasscript (AppleScript) as the language. Run NSAppleScript even suggests it, because it’s more reliable. That helped, thanks! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now