I have a custom GUI extension working that lets me override the Save command (see Rob's article http://www.curlette.com/?p=913).
Ideally I want to hide the button altogether when in the Component UI view - for which there does appear to be a doHide() method on the
Tridion.Controls.RibbonButton itself which works well when I tested in Chrome Dev Tools.
What I can't figure is how to get to the Save button in order to call doHide()?
The following gives me all the controls on the ribbon bar
Of which an object called UID_63 is the Save button:
So this works:
But there must be a nicer way than knowing that UID number?
There is a hasControl() method but I can only ever get false out of it:
And the getControl() method seems to be for adding new controls, not getting current ones?
$display.getWindow().$controls.getControl(n, f, i);