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
  • 21 Reply Likes
  • happy

Posted 8 years ago

  • 41
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 edward.caruso

edward.caruso

  • 152 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

  • 152 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...)