Open Time Machine Preferences

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Open Time Machine Preferences Tue Feb 04, 2020 4:43 am • by marcinsadowski27
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!
marcinsadowski27
 
Posts: 6
Joined: Tue Apr 02, 2019 5:15 am

Re: Open Time Machine Preferences Tue Feb 04, 2020 12:33 pm • by Mr_Noodle
Does the script run ok outside of Hazel?
Mr_Noodle
Site Admin
 
Posts: 8523
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Open Time Machine Preferences Tue Feb 04, 2020 12:54 pm • by marcinsadowski27
Not sure, how to check that?
marcinsadowski27
 
Posts: 6
Joined: Tue Apr 02, 2019 5:15 am

Re: Open Time Machine Preferences Tue Feb 04, 2020 1:13 pm • by marcinsadowski27
Ok , figured out, thanks for the lead! The script was an issue, here's the right one:

tell application "System Preferences"
activate
set current pane to pane id "com.apple.prefs.backup"
end tell
marcinsadowski27
 
Posts: 6
Joined: Tue Apr 02, 2019 5:15 am


Return to Support