Photoshop: Please add the ability for Command-J to dupe layers and layer groups

  • 41
  • Idea
  • Updated 3 years ago
  • Implemented
  • (Edited)
Command-J duplicates the entire current layer, or a portion of the current layer, if there’s a selection. It’s a great feature, and one I use daily.

For some strange reason, Command-J doesn’t do anything when there’s two layers or a layer group selected. Why? I realise there’s probably a decent technical reason for this, but a context sensitive “just dupe it” command would be really handy, even if it’s actually several different methods behind the scenes.

Is now a good time to mention that the Layer menu already contains an item that does most of these things, but it doesn’t have a keyboard shortcut by default? Pre-emptive strike: Assigning a keyboard shortcut wouldn’t help, as the menu item doesn’t duplicate selections within a layer (Command-J does).

Photo of Marc Edwards

Marc Edwards

  • 130 Posts
  • 22 Reply Likes
  • happy

Posted 9 years ago

  • 41
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 15630 Posts
  • 2367 Reply Likes
Marc, great idea. Thanks for the suggestion.
Photo of David Jensen

David Jensen

  • 131 Posts
  • 46 Reply Likes
A script could be made to do this (everything but use the cmd-j shortcut)
I'll try to put something together.
Photo of Marc Edwards

Marc Edwards

  • 130 Posts
  • 22 Reply Likes
Right now I have it set up as command-J for dupe layer and dupe selection, plus command-shift-J for dupe layers and dupe group(s).

So there's already a good workaround. Just seems like it could be even better, allowing for faster workflows and less keyboard shortcuts. Less shortcuts for more ability.
Photo of David Jensen

David Jensen

  • 131 Posts
  • 46 Reply Likes
Ah.... I misunderstood. I thought you wanted to be able to dupe a selected potion from multiple layers... i.e. Command-J with a selection for multiple layers at once.

You were just asking to combine 2 shortcuts/commands into one a single command. That definitely makes sense.

If you would still find super cmd-j with a selection useful I could give you something :-)
Photo of Marc Edwards

Marc Edwards

  • 130 Posts
  • 22 Reply Likes
We have Copy Merged for doing that (which I use regularly!).
Photo of David Jensen

David Jensen

  • 131 Posts
  • 46 Reply Likes
This wouldn't merge them. I don't know how helpful that would be, though.
Photo of Julian Kussman

Julian Kussman

  • 18 Posts
  • 0 Reply Likes
One of the first key commands I add is CMD+opt+G to dupe groups of layers. (It's not taken by anything I use)
Photo of edward.caruso

edward.caruso

  • 153 Posts
  • 42 Reply Likes
it would make sense to me that command-j would also dupe groups like it does layers. please add.
Photo of David Jensen

David Jensen

  • 131 Posts
  • 46 Reply Likes
Put this script into photoshop/presets/scripts and assign it to cmd-J. It should do exactly what you've requested.

try{
var idCpTL = charIDToTypeID( "CpTL" );
executeAction( idCpTL, undefined, DialogModes.NO );
}catch(e){
var idDplc = charIDToTypeID( "Dplc" );
var desc172 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref3 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref3.putEnumerated( idLyr, idOrdn, idTrgt );
desc172.putReference( idnull, ref3 );
var idVrsn = charIDToTypeID( "Vrsn" );
desc172.putInteger( idVrsn, 5 );
executeAction( idDplc, desc172, DialogModes.NO );
}
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 15586 Posts
  • 2342 Reply Likes
Cool.
Photo of David Jensen

David Jensen

  • 131 Posts
  • 46 Reply Likes
Photo of edward.caruso

edward.caruso

  • 153 Posts
  • 42 Reply Likes
David - that is great. thank you. Just wondering - can you script adjustment layers so that they always open in the CS3-style modal dialogues? I'm sure it can be done somehow.
Photo of David Jensen

David Jensen

  • 131 Posts
  • 46 Reply Likes
You can assign this script to a keyboard shortcut to modify any* adjustment layer with a modal dialog. (*it doesn't work with gradient maps, though.. not sure why). You can't override the double-click behavior with a script.
http://sites.google.com/site/davidjen...

A panel could be made to make new adjustment layers and automatically open their editor.
Photo of edward.caruso

edward.caruso

  • 153 Posts
  • 42 Reply Likes
Thanks again David that helps. But I'd love a preference in the next version of PS to have the modal windows replace the panel. I'm still trying to find ways to fully recreate modal dialogues like CS3. I feel that the adjustment panel is a big step backwards and it really slows me down. So many aspects of the panel bother me - I guess I'll start a proper feature request on this site. if you have any other adjustment layer scripts i would definetly check them out.
Photo of roman weiser

roman weiser

  • 61 Posts
  • 9 Reply Likes
David, I know this is basic, but how do I 'assign' your script to cmd-J? I am able to see the scrip in CS5 extended and run it manually. I can also assign a F key to run the script, but how do I have the cmd-J to run it? Thanks in advance
Photo of David Jensen

David Jensen

  • 131 Posts
  • 46 Reply Likes
Assign it using the keyboard shortcuts dialog (Edit->Keyboard Shortcuts...)
Photo of Octop

Octop

  • 27 Posts
  • 4 Reply Likes
David Jensen, you rock. If you don't mind, I'm going to post the script on my blog tonight for everyone to use and download. If you mind, let me know, I won't keep it up. :)
Photo of Shangara Singh

Shangara Singh

  • 20 Posts
  • 15 Reply Likes
The script could do with a header. I wrote one but cannot post it here (see image). Grrr! Still cannot do it.

}
Photo of dav3punk

dav3punk

  • 42 Posts
  • 5 Reply Likes
agreed. seems dumb simple to me.
Photo of dav3punk

dav3punk

  • 42 Posts
  • 5 Reply Likes
Thats an interesting script, but honestly why do we have to do this manually when it should be a feature?
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 15586 Posts
  • 2342 Reply Likes
The point of this site is for folks to make feature requests for improvements directly to Photoshop - and this idea is a good one that's under consideration. A side benefit is that cool users like David Jensen and Shangara are posting helpful scripts to help improve users workflows in the meantime.
Photo of Marc Edwards

Marc Edwards

  • 130 Posts
  • 22 Reply Likes
It seems like a perfect demonstration of why scripting ability and direct feedback to the Photoshop team is a great combination. It lets fringe features be built and tested.

"Should be a feature" only exists after someone—either from the public or at Adobe—has suggested it.

I've been pushing for this feature for almost a year now and am very excited that maybe some day soon it'll be part of Photoshop and therefore accelerate my workflow.
Photo of Scott Mahn

Scott Mahn

  • 178 Posts
  • 47 Reply Likes
David's script is fantastic. Thanks David.
Photo of Howard Pinsky

Howard Pinsky, Champion

  • 117 Posts
  • 29 Reply Likes
Great script, David! I've been looking for a temporary solution to this.
Photo of p.guell

p.guell

  • 9 Posts
  • 7 Reply Likes
Simple solution:
If you select the layers or groups you want to dupe,
you can option - drag right on the layers palette, up or down.
This will duplicate multiple layers very easily.
No script needed. Adobe is vaguely aware of this.

[Personally, I would rather this didn't work this way...
I would like a preference or documented keyboard shortcut so I could stop it!]
Photo of David Dobish

David Dobish, Senior QE Photoshop

  • 200 Posts
  • 51 Reply Likes
Maybe everyone already knows about this but scripts can be automatically generated using the scriptlistner

1. Open folder where PS is installed.
2. Adobe\Adobe Photoshop CS5 (64 Bit)\Scripting\Utilities
3. Place the ScriptListener plugin into your root plugins directory.
4. Restart PS
5. Now almost every thing you do, will be written out to a file on your desktop called. ScriptingListenerJS
6. You can copy and paste the chucks of code into a seperate script to run the given function.

1. Open Extendscript
2. Paste the code into a new file.
3. save the file out as foo.JS

You now have a stand alone script.
Photo of Shangara Singh

Shangara Singh

  • 20 Posts
  • 15 Reply Likes
This has got to be a cruel Adobe joke! I just assumed, like millions of other users, the plug-in is for script writers who want to debug their scripts.

Why isn't there an interface to turn the ScriptListner on and off and given a name that would attract non-scripting people to try it, or a Scripts panel on par with Actions?
Photo of christoph pfaffenbichler

christoph pfaffenbichler, Champion

  • 1332 Posts
  • 212 Reply Likes
Is this a joke on your part?
Adobe provides ExtendScript Toolkit to edit and test Scripts, a Scripts Panel in Photoshop seems utterly unnecessary.

Scripting is a slightly more complicated technique than using Actions (ease of use being one of the advantages of Actions) – if you want to give Scripting a try Photoshop ships with the documentation, just check out the Folder »Scripting« beside the application.
Photo of Shangara Singh

Shangara Singh

  • 20 Posts
  • 15 Reply Likes
I don't want to give scripting a try. That's the point of the post (YMMV).
Photo of p.guell

p.guell

  • 9 Posts
  • 7 Reply Likes
I would rather not try scripting either...but if I do try, is there a way to STOP duplicating ONLY locked layers or groups - but not selections/unlocked layers/groups with the (command-)option-drag keyboard shortcut?? I can't envision how that could possibly work.
Photo of roman weiser

roman weiser

  • 61 Posts
  • 9 Reply Likes
I think PSD people should listen and listen carefully to what is being said here and in many other topic discussions. And I think they do. After all, we are the people buying their product - their future is in our hands. We provide invaluable feedback through this forum. Simply put, without us - their product would not be in stores and without our feedback it would not be as good as it is today, as I believe most 'bugs' are caught right here. A simple functionality such as allowing a layer set to be duplicated by pressing command J should be one of PSD's basic features - no question, and I trust the next releases will have it included. While we all appreciate input from all those out there finding pleasure writing customs scripts, most of PSD users rely on it's basic functionality. PSD, despite it's monopoly, proven worth the money and our trust over many years. I continue to believe that Adobe is taking our feedback seriously, because the day they stop, it'll to be the day they loose the right to call Photoshop the most intuitive, user friendly and complete image editing program in the World.

Jeffrey?
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 15630 Posts
  • 2367 Reply Likes
As I said above, the point of this site is for folks to make feature requests for improvements directly to the Photoshop team - and this idea is a good one that's under consideration. A side benefit is that cool users like David Jensen and Shangara are posting helpful scripts to help improve users workflows in the meantime.

The other aspect is, we can't implement everyone's pet feature request. Some changes that are requested are so esoteric that scripting really is the best answer to some users custom workflows.
Photo of edward.caruso

edward.caruso

  • 153 Posts
  • 42 Reply Likes
to who ever is complaining about scripts - this one and others from David work so well that it solves many issues for me. The other ones involve modal adjustment layers. scripting is really powerful, while i haven't put the time aside to learn to make them for myself, i've used ones made already and they make a tremendous difference in my workflow. not every feature request will get addressed by adobe (b/c many are not useful to many users) so scripting can fill in the pieces quite well.
Photo of dav3punk

dav3punk

  • 42 Posts
  • 5 Reply Likes
The scripting is not an issue, but not every one CAN or WANTS to script- especially something as basic as this. Programmers script. Artists do not. I agree the script is a solution that works. The issue is that Photoshop already has the duplication functionality that works with layers, and it should automatically work with anything within the layers panel. Hardly a pet feature. Scripting something like this is really just a band-aid for functionality that isn't a complete thought. I guess this is a common result of working ON the program- not in the program.

"Photoshop the most intuitive, user friendly and complete image editing program in the World" - not sure where that came from, but this is NOT entirely accurate.
Photo of christoph pfaffenbichler

christoph pfaffenbichler, Champion

  • 1346 Posts
  • 212 Reply Likes
»Programmers script. Artists do not.«
If certain artists don’t feel like learning to use and maintain their tools they may have high brush-related-expenses ...

»"Photoshop the most intuitive, user friendly and complete image editing program in the World" - not sure where that came from, but this is NOT entirely accurate.«
Then please do tell, which program is?
Photo of dav3punk

dav3punk

  • 42 Posts
  • 5 Reply Likes
Certain programmers don't feel like learning how to paint either because they are busy thinking they are smarter than everyone else...one can maintain their tools just fine without scripting.

There is NO one program that is the best at anything or does everything perfectly. Some functions are intuitive, but there are many features that are completely unintuitive. Photoshop has a Legacy of being the first, but like many other software packages is getting bloated with useless features and not refining its current workflows. It's like saying Microsoft Word is the best word processing software.
Photo of christoph pfaffenbichler

christoph pfaffenbichler, Champion

  • 1346 Posts
  • 212 Reply Likes
»There is NO one program that is the best at anything«
While it is certainly possible for other programs to be the equal or superior in any one or all aspects it would seem to me that that does not at all rule out the possibility for relative superiority at all.
Comparison can be used to arrive at a ranking of the objects of said comparison, so your statement seems peculiar.

Edit: But maybe I misunderstand ...
Photo of christoph pfaffenbichler

christoph pfaffenbichler, Champion

  • 1346 Posts
  • 212 Reply Likes
I guess I’m just being cantankerous, so please ignore the last post.
Photo of David Jensen

David Jensen

  • 131 Posts
  • 46 Reply Likes
try{}catch(e){}
^ that's the extent of the code I wrote. The rest I just copied from a Photoshop plugin that spits out a chunk of code every time something.is done in Photoshop.

That doesn't make me a programmer any more than painting a few brush strokes makes me an artist.

Scripting is just another tool, and it can be used by an artist. I'm sure there are some who think artists shouldn't use a computer at all.
Photo of roman weiser

roman weiser

  • 61 Posts
  • 9 Reply Likes
DaveP - out of curiosity - would you name one professional image editing program that is in the same league with Photoshop today? No challenge intended here - just wondering.
Photo of edward.caruso

edward.caruso

  • 153 Posts
  • 42 Reply Likes
i agree with you. command-j should dupe a layer. it always annoyed me that it didn't. but for awhile, maybe 6 months ago i loaded a script, assigned command-j to it and now it dupes a layer or a group. so i dont think about it anymore. i didn't have to make the script but i can enjoy the workflow productivity it brings. there are bigger issues to me that i'd like addressed - so if his can be solved by a workaround that ends up being the same key command as the ideal behavior - i'm ready to let it be.
Photo of Mark Reynolds

Mark Reynolds

  • 13 Posts
  • 4 Reply Likes
This has been asked for many times. The fact that Command J on a Layer Group does nothing is not consistent. There is also no practical or technical reason why this couldn't be implemented as art of the app.

Why was this left out? The command J shortcut was available from the very early versions of Photoshop to duplicate layers, it's not a recent addition. Layer "Sets" (layer called Groups) were introduced first of all I believe in Photoshop version 6. At this point it probably didn't occur to anyone to extend this functionality to Groups. And it's never been added. Just an oversight as far as I can see.
Photo of FerdiCildiz

FerdiCildiz

  • 69 Posts
  • 8 Reply Likes
Very good idea and solution. But i have a problem, I added it its directory but it doesn't appear in File > Scripts menu.
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 15586 Posts
  • 2344 Reply Likes
Did you restart Photoshop?
Photo of FerdiCildiz

FerdiCildiz

  • 69 Posts
  • 8 Reply Likes
sure
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 15586 Posts
  • 2344 Reply Likes
And it didn't show up after restart?
Photo of FerdiCildiz

FerdiCildiz

  • 69 Posts
  • 8 Reply Likes
unfortunately. i also tried restart again after your comment but it didn't make any sense.
Photo of David Jensen

David Jensen

  • 131 Posts
  • 46 Reply Likes
did you save it as a ".jsx" ?

Here is as a file:
http://sites.google.com/site/davidjen...
Photo of Chris Page

Chris Page

  • 39 Posts
  • 3 Reply Likes
I'm excited to see this in CS6

:)

Thank you everyone for requesting and coming up with a solution for the meantime
Photo of David A Rogers

David A Rogers

  • 41 Posts
  • 1 Reply Like
Has this been officially announced?
Photo of Chris Page

Chris Page

  • 39 Posts
  • 3 Reply Likes
no no, sorry, i just saw the under consideration and the work around.
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 15630 Posts
  • 2367 Reply Likes
Official Response
This is implemented in Photoshop CS6. Cmd/Ctrl + J duplicates multiple selected layers as well as layer groups.
Photo of Jaroslav Bereza

Jaroslav Bereza

  • 880 Posts
  • 221 Reply Likes
This was implement before CS6. I set shortcut for duplicate dialog. Using this shortcut with "CTRL + ALT + SHIFT" modificators doesn't shows dialog. I used it in CS5 a lot :-)