error javascript (no such element)


i trying learn javascript. plan select specific folder, select specific layer move layer specific folder. it's last line below giving me error. says 'no such element'

any please,,,,

 

 

 

var selectlayerfolder = app.activedocument.layersets.getbyname('folder3')

alert (selectlayerfolder.name + " selected")

var selectlayer2 = app.activedocument.layers.getbyname('7')

alert(selectlayer2.name + ' selected')

{

app.activedocument.layers[selectlayer2].move(app.activedocument.layersets[selectlayerfolde r], elementplacement.placeafter)

}

hi

 

the move statement has not moved layer layerset (group).

its move layer before,after,begin , end of layerset.

you have use movetoend statement.

use code....

 

var docref =app.activedocument;

var layset=docref.layersets.getbyname('folder3');

var layerref = docref.layers.getbyname('7');

layerref.movetoend (layset);

 

 

-yajiv



More discussions in Photoshop Scripting


adobe

Comments

Popular posts from this blog

Reader DC

AdobeIDの作り方

Adobe InDesign CC 2017 has stopped working