Open Time Machine Preferences

Hello!
I wanted to set up a simple rule that opens Time Machine tab in system preferences automatically when I connect my external back up drive. I did this:
"If all of the following conditions are met - Name - is - Mac Mini Backup (which is the name of my drive)
do the following to the matched file or folder:
Run Apple Script - embedded script"
And the script goes like this:
tell application "System Events"
tell application process "SystemUIServer"
tell (first menu bar item of menu bar 1 whose value of attribute "AXDescription" is "time machine")
perform action "AXPress"
click UI element "Open Time Machine Preferences…" of its last menu
end tell
end tell
end tell
But I have an error showing up which says: "System Events got an error: Can't get attribute". I checked Hazel Helper at Accessibility tab in Security & Privacy, but it shows the error anyway. I'm on Catalina. I would be really grateful for any solution to this.
Thank you!
I wanted to set up a simple rule that opens Time Machine tab in system preferences automatically when I connect my external back up drive. I did this:
"If all of the following conditions are met - Name - is - Mac Mini Backup (which is the name of my drive)
do the following to the matched file or folder:
Run Apple Script - embedded script"
And the script goes like this:
tell application "System Events"
tell application process "SystemUIServer"
tell (first menu bar item of menu bar 1 whose value of attribute "AXDescription" is "time machine")
perform action "AXPress"
click UI element "Open Time Machine Preferences…" of its last menu
end tell
end tell
end tell
But I have an error showing up which says: "System Events got an error: Can't get attribute". I checked Hazel Helper at Accessibility tab in Security & Privacy, but it shows the error anyway. I'm on Catalina. I would be really grateful for any solution to this.
Thank you!