Skip to content

Instantly share code, notes, and snippets.

@marianomike
Last active August 29, 2016 02:21
Show Gist options
  • Save marianomike/ace7847fe2d2ba51b23da54bf02fa9aa to your computer and use it in GitHub Desktop.
Save marianomike/ace7847fe2d2ba51b23da54bf02fa9aa to your computer and use it in GitHub Desktop.
var onRun = function(context) {
var doc = context.document;
var selection = context.selection;
if(selection.count() == 0){
doc.showMessage("Please select something.");
}else{
for(var i = 0; i < selection.count(); i++){
var layer = selection[i];
var layerName = layer.name();
var layerPrefix = "prefix_";
layer.setName(layerPrefix + layerName);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment