Skip to content

Instantly share code, notes, and snippets.

@darkwark
Created November 13, 2014 11:27
Show Gist options
  • Save darkwark/4b7601f273009d92dae3 to your computer and use it in GitHub Desktop.
Save darkwark/4b7601f273009d92dae3 to your computer and use it in GitHub Desktop.
Script duplicates selected layer and places it on the top of layers stack
/*
* Adobe Photoshop Script
*
* DESCRIPTION:
* Script duplicates selected layer and places it on the top of layers stack
*
* INSTALATION:
* To access script from "File > Scripts", place it into "Photoshop/Presets/Scripts" and restart your Photoshop
* You can also set up hotkey in "Edit > Keyboard Shortcuts..."
*
* (c) Kamil Khadeyev, 2014/NOV
* http://twitter.com/darkwark
*/
//Duplicate selected layer and place it on the top
var actLayer = app.activeDocument.activeLayer,
newLayer = actLayer.duplicate(app.activeDocument.layers[0], ElementPlacement.PLACEBEFORE);
//OPTIONAL: Rename duplicated layer
//newLayer.name = "[DUPLICATE]" + actLayer.name;
//Select duplicated layer:
app.activeDocument.activeLayer = newLayer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment