Skip to main content
jim_blandford
Participant
August 11, 2014
Question

Move layer group script

  • August 11, 2014
  • 2 replies
  • 1308 views

Found this script to do what I want but cannot get it to work with Photoshop CC 2014 on OSX 10.9.4.

// tell extendscript toolkit which adobe application to target;

#target photoshop

// determine the document on which to work;

var myDoc = app.activeDocument;

// define which open document to get the layergroup from;

// one could also open a document from a specific position on the harddrive.

var theLayerSetDoc = app.documents.getByName(“Watermark1600.psd”);

// switch photoshop’s focus to the group-document to be able to work with it;

app.activeDocument = theLayerSetDoc;

// define the group, actually one could avoid the variable and just process it directly;

var theSet = theLayerSetDoc.layerSets.getByName(“Watermark”);

// do the duplication;

theSet.duplicate(myDoc,ElementPlacement.PLACEATBEGINNING);


Keep getting

Error 8: Syntax error.

Line: 7

->  var theLayerSetDoc = app.documents.getByName(“Watermark1600.psd”);

Document name matches perfectly.

Had this working under PS CC version before 2014, but remembered I had to make a very subtle change to get a script originally for CS to work for CC? Cannot remember what it was!

Help much appreciated, thanks in advance.

This topic has been closed for replies.

2 replies

c.pfaffenbichler
Community Expert
Community Expert
August 12, 2014

Could the inverted commas be the problem?

c.pfaffenbichler
Community Expert
Community Expert
August 12, 2014

Just to make sure: That file is open?

Could you provide a screenshot in non-tabbed view?

jim_blandford
Participant
August 12, 2014

c.pfaffenbichler yes file is open.

Hope this is what you mean by a screenshot in non-tabbed view.

(Edit: Replaced with better screenshot)

c.pfaffenbichler
Community Expert
Community Expert
August 12, 2014

What does

alert (app.documents.getByName("Watermark1600.psd"))

get you?