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.
Copy link to clipboard
Copied
Just to make sure: That file is open?
Could you provide a screenshot in non-tabbed view?
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)
Copy link to clipboard
Copied
What does
alert (app.documents.getByName("Watermark1600.psd"))
get you?
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
Copy link to clipboard
Copied
I tried removing inverted commas previously
Don’t remove them, replace them with the proper ones in ESTK.
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.
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.
Copy link to clipboard
Copied
Double quotes didn't work for me (CC2014). Not sure if its different in other versions.
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.
Copy link to clipboard
Copied
Wasn't me Phil, but thanks.
Right you are
Copy link to clipboard
Copied
Could the inverted commas be the problem?