Ecco uno script che ho appena scritto che lo farà. Questo ti porterà alla scheda delle scorciatoie del pannello delle preferenze della tastiera e seleziona una riga dalle colonne sinistra e destra:
tell application "System Preferences"
activate
reveal anchor "shortcutsTab" of pane id "com.apple.preference.keyboard"
end tell
tell application "System Events"
tell application process "System Preferences"
repeat while not (window 1 exists)
end repeat
tell window 1
#modify these to specify a row in the left column, or the right column, respectively
repeat while not (row 3 of table 1 of scroll area 1 of splitter group 1 of tab group 1 exists)
end repeat
select row 3 of table 1 of scroll area 1 of splitter group 1 of tab group 1
repeat while not (row 1 of outline 1 of scroll area 2 of splitter group 1 of tab group 1 exists)
end repeat
select row 1 of outline 1 of scroll area 2 of splitter group 1 of tab group 1
end tell
end tell
end tell
Ecco la versione che puoi utilizzare che identifica le righe per nome. Una specie di hacky, ma dovrebbe funzionare bene.
tell application "System Preferences"
activate
reveal anchor "shortcutsTab" of pane id "com.apple.preference.keyboard"
end tell
tell application "System Events"
tell application process "System Preferences"
repeat while not (window 1 exists)
end repeat
tell window 1
#modify these to specify a row in the left column, or the right column, respectively
repeat while not (rows of table 1 of scroll area 1 of splitter group 1 of tab group 1 exists)
end repeat
repeat with current_row in (rows of table 1 of scroll area 1 of splitter group 1 of tab group 1)
if value of static text 1 of current_row is equal to "Services" then
select current_row
exit repeat
end if
end repeat
repeat while not (rows of outline 1 of scroll area 2 of splitter group 1 of tab group 1 exists)
end repeat
repeat with current_row in rows of outline 1 of scroll area 2 of splitter group 1 of tab group 1
if name of UI element 2 of current_row is equal to "Open URL" then
select current_row
exit repeat
end if
end repeat
end tell
end tell
end tell