This small script should help – provided you have a reference to the LayerSet, you can move a Layer into it:
var doc = app.documents.add() // create a Doc var lay = doc.activeLayer.duplicate() // duplicate the background layer var set = doc.layerSets.add(); // add a LayerSet lay.move(set, ElementPlacement.INSIDE) // move the duplicate layer inside the LayerSet
actually i need to move the current texture layer to active visible group.
Thank you so much
actually i want a script to deal with my bottom layergroup named as texture and its needs to duplicate that texture layer group and merge that layer and also need to run a photoshop action and finally the texture Artlayer need to move into the top active layergroup.
if the script founds the texture layer in bottom of the document it must be go and placed in the layer group which is active