Clever if more complex than my limited AppleScript experience would have led me to. :-)
But I don't recall System Settings (or some other choices) being in the sidebar, only in the View menu. If there's a way to add those to the sidebar, I haven't found it yet, although it will temporarily appear if searched for.
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags: