Is there a JavaScript to show (or hide) the sidebar?


#1

Hello all,

I am working on a script, and I need a way to hide the sidebar if is showing. Can this be done with JavaScript?

Thanks!

Jim


#2

AppleScript would work as well. Any ideas?


#3

I’m a newbie in the automation department but I think you can achieve this by programmatically clicking the menubar item View > Show Sidebar.

For reference: https://github.com/dtinth/JXA-Cookbook/wiki/System-Events#clicking-menu-items