Outline to new layer

Can we get a button that outlines to a new layer? (the result of the outline is put on a new layer)
I wrote a script to do this, but it is unable to perform the action with multiple frames selected.