Which parts do you need help with?
Re: #1
- Test for selection is _isnull_selection.
- Unselect is deselect.
Re: #2
- This is the one I'd expect to be difficult in SE; the toolbar API surface area is limited, and is mostly undocumented. Look in macros\toolbar.e for functions marked with "_command".
- To hide a toolbar, use tbHide( toolbar_form_name ).
- I don't know offhand how to dynamically find a list of "all known toolbars". Scrounging in macros\toolbar.e might turn up something.
- I don't know offhand how to check whether any toolbars are visible. Again, scrounging in macros\toolbar.e might turn up something.
Re: #3
- Toggling command line is cmdline_toggle.