Skip to main content
Inspiring
July 17, 2013
Answered

moveToBeginning(); < what is this?

  • July 17, 2013
  • 1 reply
  • 1709 views

I was poking around in the scripting reference for javascript and I came across this line in one example.

newItem.moveToBeginning( newGroup );

I'm totally new to scripting and I have little to no knoledge of javascript. I understand what the example does and most of the parts but there is not documentation on moveToBeginning();

it only shows up in one example and nowhere else. I kinda understand what it does but where is the documentation? and where can I find similar functions?

is there a moveToEnd()?



This topic has been closed for replies.
Correct answer CarlosCanto

yes, there is a moveToEnd() method as well, both still work but have been deprecated and replaced by the newer move() method.

newItem.move( newGroup , ElementPlacement.PLACEATBEGINNING);


1 reply

CarlosCanto
Community Expert
CarlosCantoCommunity ExpertCorrect answer
Community Expert
July 17, 2013

yes, there is a moveToEnd() method as well, both still work but have been deprecated and replaced by the newer move() method.

newItem.move( newGroup , ElementPlacement.PLACEATBEGINNING);


mec_osAuthor
Inspiring
July 17, 2013

ic. thanks you.

the moveToEnd() didn't do anything but the move() method worked. they should take it our of their example. it confused me for half a day

pixxxelschubser
Community Expert
Community Expert
July 18, 2013

mec_os wrote:

… the moveToEnd() didn't do anything …

Try this way:

// e.g. at first create a new document with only one object

var newGroup = app.activeDocument.groupItems.add();

app.activeDocument.layers[0].pathItems[0].moveToEnd(newGroup);