I'm trying to save a shelf item using the script editor.
The first thing I need to do is duplicate a shader. Works fine in hypershade, but the script editor doesn't appear to notice it. No script appears, so there's nothing to save to the shelf. This only ssems to happen with duplicate shader.
In the script editor, there is a menu option called 'Echo All Commands'. Activate that and things that are normally suppressed will show up in the script editor. Make sure to turn it back off when you're done, or it will get VERY cluttered as you continue to work.
Sometimes, though, things get complicated when tools from the Maya UI themselves run complicated procedures and scripts instead of simple commands; that may or may not be the case with the shader duplication you're doing. Give it a try, but if you run into glitches, you may have to hunt down more appropriate commands in the documentation.