• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Move layer group script

New Here ,
Aug 11, 2014 Aug 11, 2014

Copy link to clipboard

Copied

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.

TOPICS
Actions and scripting

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Aug 11, 2014 Aug 11, 2014

Copy link to clipboard

Copied

Just to make sure: That file is open?

Could you provide a screenshot in non-tabbed view?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 12, 2014 Aug 12, 2014

Copy link to clipboard

Copied

c.pfaffenbichler yes file is open.

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

(Edit: Replaced with better screenshot)

Screen Shot 2014-08-12 at 09.14.13.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 12, 2014 Aug 12, 2014

Copy link to clipboard

Copied

What does

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

get you?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 12, 2014 Aug 12, 2014

Copy link to clipboard

Copied

Thank you for your replies.

The code you suggested gives Error 4: Unterminated string constant.

I tried removing inverted commas previously, but get Error 2: Watermark1600 is undefined.

Not sure whether it makes any difference but I created the script in Text Edit and saved as a .jsx, and script is located in Applications/Adobe Photoshop CC 2014/Presets/Scripts

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 12, 2014 Aug 12, 2014

Copy link to clipboard

Copied

I tried removing inverted commas previously

Don’t remove them, replace them with the proper ones in ESTK.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 26, 2015 Mar 26, 2015

Copy link to clipboard

Copied

I know this is late after the thread, but for those who come across this - use ' instead of " in the getbyname brackets.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 26, 2015 Mar 26, 2015

Copy link to clipboard

Copied

It does not matter if you use a single quote or double quote, but you must use the same quote at both ends.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 26, 2015 Mar 26, 2015

Copy link to clipboard

Copied

Double quotes didn't work for me (CC2014). Not sure if its different in other versions.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 26, 2015 Mar 26, 2015

Copy link to clipboard

Copied

The code you posted at the start shows that the quotes are not the same, this is normal if you have copied code from the pdf's, it is a common error with the documentation. I don't have CC so can't tell if anything has changed.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 26, 2015 Mar 26, 2015

Copy link to clipboard

Copied

LATEST

Wasn't me Phil, but thanks.
Right you are

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 12, 2014 Aug 12, 2014

Copy link to clipboard

Copied

Could the inverted commas be the problem?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines