-
1. Re: moving group (of layers) from one psd to another using action?
c.pfaffenbichler Dec 22, 2010 11:38 PM (in response to bsnyder175)Layer > Duplicate Group records, but I’m afraid it records the target document.
So, unless someone else has more insight, I would recommend a Scripting solution for that task.
But if you want to run a Batch you should take care to not have any other files open, as that might cause confusion.
Scripting-wise something like this might work:
#target photoshop var myDoc = app.activeDocument; var theLayerSetDoc = app.documents.getByName("Untitled-1"); app.activeDocument = theLayerSetDoc; var theSet = theLayerSetDoc.layerSets.getByName("Group 1"); theSet.duplicate(myDoc, ElementPlacement.PLACEATBEGINNING);If you want to try it correct the names of the document and the layerSet and paste the text into a new file in ExtendScript Toolkit (part of Photoshop’s installation, Applications/Utilities/Adobe Utilities/ExtendScript Toolkit CS4) and save it as a jsx-file into Photoshop’s Presets/Scripts-folder.
After restarting Photoshop the Script should be available under File > Scripts and can be recorded into an Action.
This would work only if the file with the group is open and the document that should receive the group is the active one.
-
2. Re: moving group (of layers) from one psd to another using action?
bsnyder175 Dec 26, 2010 6:20 PM (in response to c.pfaffenbichler)I apologize for the delayed response, what with the Holidays. I hope you had a great Christmas.
In regards to your solution, it worked! Thank you! I'm really happy with the results. If you don't mind, could you explain each line of the script so I can better understand what's happening? Is there also a way to have the script navigate within nested groups? (i.e. "Group 1>Shading" instead of just "Shading"). It looks like in order for this to work, my shading group must not be nested inside of anything any other groups, or it will error. This really isn't a big problem because I can just drag the shading group out, but if I could have it navigate within nested group(s) to my shading group, that would be great.
Thanks again! You ROCK!
-
3. Re: moving group (of layers) from one psd to another using action?
c.pfaffenbichler Dec 26, 2010 11:53 PM (in response to bsnyder175)I’try to annotate the Script:
// 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("Untitled-1"); // 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("Group 1"); // do the duplication; theSet.duplicate(myDoc, ElementPlacement.PLACEATBEGINNING);Is there also a way to have the script navigate within nested groups? (i.e. "Group 1>Shading" instead of just "Shading").
Group-content is not a direct child of the document and subsequently has to be addressed via its parent, e.g.
var theSet = theLayerSetDoc.layerSets.getByName("Group 1").layerSets.getByName("Shading") -
4. Re: moving group (of layers) from one psd to another using action?
bsnyder175 Dec 27, 2010 10:20 AM (in response to c.pfaffenbichler)Fantastic, thank you so much! The script comments were very insightful.
Thanks again!

