Skip to content

Instantly share code, notes, and snippets.

@justintaylor-dev
Created October 13, 2022 21:33
Show Gist options
  • Save justintaylor-dev/be39e3bb563cdb0b976cea9c7497c1cc to your computer and use it in GitHub Desktop.
Save justintaylor-dev/be39e3bb563cdb0b976cea9c7497c1cc to your computer and use it in GitHub Desktop.
Letters to Layers #code_aeft
function rename(word) {
var array = app.project.activeItem.selectedLayers;
for (var i = 0; i < array.length; i++) {
var layer = array[i];
if(word[i]){
layer.name = word[i];
}
}
}
var dialog = new Window("window");
dialog.text = "Letters To Layers";
dialog.orientation = "column";
dialog.alignChildren = ["center","top"];
dialog.spacing = 10;
dialog.margins = 16;
var edittext1 = dialog.add('edittext {properties: {name: "edittext1"}}');
edittext1.preferredSize.width = 300;
var button1 = dialog.add("button", undefined, undefined, {name: "button1"});
button1.text = "Rename";
button1.onClick = function(){
rename(edittext1.text);
}
dialog.show();
@justintaylor-dev
Copy link
Author

letters-to-layers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment