NOTE: This script has been updated to make it more forgiving of what layers are selected.Although you only need to select the highest layer in the parental heirarchy you wish toduplicate, if you select all the layers it will produce the same result.

------An example of the working script :

1. Select the highest layer in the parental heirarchy you want to duplicate and run the script.

2. The result is a complete duplicate of the original parental heirarchy.