Custom button idea/request: smart zip/unzip

Hi there. I wouldn't mind rebuilding a script that I had on a different file manager. The fellow (Highend, I believe) made a script that would unzip an archive into a same-named folder at the same location, and also delete the original achieve afterward.

For example, if I have a file called and it is in location C:/, then I can select the file and run the script (via toolbar button). After running the script, I have a folder there called C:/My/ and the zip file has been deleted.

An additional step that the script did which was really nice was that it would check for redundant directories. For example, many times when there is a zip like "C:/" it will actually unzip into "C:/My/My/" Highend's script would move the contents of the deeper-nested /My and move them to the parent folder /My/. Does that make sense?

In addition to this functionality: I would propose, that this same script (on the same button) would check if the item selected is or is not an archive... If it is an archive, then extract it as described above. But it it is not an archive (i.e. there are files and/or folder selected) then zip them up. (But don't delete the originals.)

What do you guys think? Any takers?

Always interested in both added DOpus functiinality and a script from which I can learn.