Last active
November 19, 2018 10:47
-
-
Save joonaspaakko/29c8bc6321fdb76b8fd6daa32745724e to your computer and use it in GitHub Desktop.
Example code generated with ScriptUI Dialog Builder: https://github.com/joonaspaakko/ScriptUI-Dialog-Builder-Joonas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Code for Import https://scriptui.joonas.me — (Triple click to select): | |
{"activeId":6,"items":{"item-0":{"id":0,"type":"Dialog","parentId":false,"style":{"text":"Export Layers Inside Selected Group","preferredSize":[0,0],"margins":16,"orientation":"column","spacing":10,"alignChildren":["center","top"]}},"item-1":{"id":1,"type":"Checkbox","parentId":6,"style":{"text":"PSD","preferredSize":[0,0],"alignment":null}},"item-2":{"id":2,"type":"Checkbox","parentId":6,"style":{"text":"TIFF","preferredSize":[0,0],"alignment":null}},"item-3":{"id":3,"type":"Checkbox","parentId":6,"style":{"text":"JPEG","preferredSize":[0,0],"alignment":null,"checked":true}},"item-4":{"id":4,"type":"Checkbox","parentId":6,"style":{"text":"PNG","preferredSize":[0,0],"alignment":null}},"item-5":{"id":5,"type":"Checkbox","parentId":6,"style":{"text":"PDF","preferredSize":[0,0],"alignment":null}},"item-6":{"id":6,"type":"Panel","parentId":9,"style":{"text":"File format","preferredSize":[0,0],"margins":10,"orientation":"row","spacing":10,"alignChildren":["left","top"],"alignment":null}},"item-7":{"id":7,"type":"Panel","parentId":9,"style":{"text":"File name options","preferredSize":[0,0],"margins":10,"orientation":"column","spacing":10,"alignChildren":["left","top"],"alignment":null}},"item-8":{"id":8,"type":"EditText","parentId":14,"style":{"text":"","preferredSize":[90,0],"alignment":null}},"item-9":{"id":9,"type":"Group","parentId":0,"style":{"preferredSize":[0,0],"margins":0,"orientation":"column","spacing":10,"alignChildren":["fill","top"],"alignment":null}},"item-10":{"id":10,"type":"Group","parentId":0,"style":{"preferredSize":[0,0],"margins":0,"orientation":"row","spacing":10,"alignChildren":["left","top"],"alignment":null}},"item-11":{"id":11,"type":"Button","parentId":10,"style":{"text":"Save","justify":"center","preferredSize":[0,0],"alignment":null}},"item-12":{"id":12,"type":"Button","parentId":10,"style":{"text":"Cancel","justify":"center","preferredSize":[0,0],"alignment":null}},"item-13":{"id":13,"type":"StaticText","parentId":14,"style":{"text":"Prefix:","justify":"left","preferredSize":[0,0],"alignment":null}},"item-14":{"id":14,"type":"Group","parentId":22,"style":{"preferredSize":[0,0],"margins":0,"orientation":"column","spacing":10,"alignChildren":["left","top"],"alignment":null}},"item-15":{"id":15,"type":"Checkbox","parentId":7,"style":{"text":"Use layer name","preferredSize":[0,0],"alignment":null}},"item-16":{"id":16,"type":"Group","parentId":22,"style":{"preferredSize":[0,0],"margins":0,"orientation":"column","spacing":10,"alignChildren":["left","top"],"alignment":null}},"item-17":{"id":17,"type":"StaticText","parentId":16,"style":{"text":"Custom name:","justify":"left","preferredSize":[0,0],"alignment":null}},"item-18":{"id":18,"type":"EditText","parentId":16,"style":{"text":"File Name ","preferredSize":[160,0],"alignment":null}},"item-19":{"id":19,"type":"Group","parentId":22,"style":{"preferredSize":[0,0],"margins":0,"orientation":"column","spacing":10,"alignChildren":["left","top"],"alignment":null}},"item-20":{"id":20,"type":"StaticText","parentId":19,"style":{"text":"Suffix:","justify":"left","preferredSize":[0,0],"alignment":null}},"item-21":{"id":21,"type":"EditText","parentId":19,"style":{"text":"","preferredSize":[90,0],"alignment":null}},"item-22":{"id":22,"type":"Group","parentId":7,"style":{"preferredSize":[0,0],"margins":0,"orientation":"row","spacing":10,"alignChildren":["left","center"],"alignment":null}},"item-23":{"id":23,"type":"Divider","parentId":7,"style":false}},"order":[0,9,7,15,23,22,14,13,8,16,17,18,19,20,21,6,3,4,1,5,2,10,12,11]} | |
*/ | |
// DIALOG | |
// ====== | |
var dialog = new Window("dialog"); | |
dialog.text = "Export Layers Inside Selected Group"; | |
dialog.orientation = "column"; | |
dialog.alignChildren = ["center","top"]; | |
dialog.spacing = 10; | |
dialog.margins = 16; | |
// GROUP1 | |
// ====== | |
var group1 = dialog.add("group"); | |
group1.orientation = "column"; | |
group1.alignChildren = ["fill","top"]; | |
group1.spacing = 10; | |
group1.margins = 0; | |
// PANEL1 | |
// ====== | |
var panel1 = group1.add("panel"); | |
panel1.text = "File name options"; | |
panel1.orientation = "column"; | |
panel1.alignChildren = ["left","top"]; | |
panel1.spacing = 10; | |
panel1.margins = 10; | |
var checkbox1 = panel1.add("checkbox"); | |
checkbox1.text = "Use layer name"; | |
var divider1 = panel1.add("panel"); | |
divider1.alignment = "fill"; | |
// GROUP2 | |
// ====== | |
var group2 = panel1.add("group"); | |
group2.orientation = "row"; | |
group2.alignChildren = ["left","center"]; | |
group2.spacing = 10; | |
group2.margins = 0; | |
// GROUP3 | |
// ====== | |
var group3 = group2.add("group"); | |
group3.orientation = "column"; | |
group3.alignChildren = ["left","top"]; | |
group3.spacing = 10; | |
group3.margins = 0; | |
var statictext1 = group3.add("statictext"); | |
statictext1.text = "Prefix:"; | |
var edittext1 = group3.add("edittext"); | |
edittext1.minimumSize.width = 90; | |
// GROUP4 | |
// ====== | |
var group4 = group2.add("group"); | |
group4.orientation = "column"; | |
group4.alignChildren = ["left","top"]; | |
group4.spacing = 10; | |
group4.margins = 0; | |
var statictext2 = group4.add("statictext"); | |
statictext2.text = "Custom name:"; | |
var edittext2 = group4.add("edittext"); | |
edittext2.text = "File Name "; | |
edittext2.minimumSize.width = 160; | |
// GROUP5 | |
// ====== | |
var group5 = group2.add("group"); | |
group5.orientation = "column"; | |
group5.alignChildren = ["left","top"]; | |
group5.spacing = 10; | |
group5.margins = 0; | |
var statictext3 = group5.add("statictext"); | |
statictext3.text = "Suffix:"; | |
var edittext3 = group5.add("edittext"); | |
edittext3.minimumSize.width = 90; | |
// PANEL2 | |
// ====== | |
var panel2 = group1.add("panel"); | |
panel2.text = "File format"; | |
panel2.orientation = "row"; | |
panel2.alignChildren = ["left","top"]; | |
panel2.spacing = 10; | |
panel2.margins = 10; | |
var checkbox2 = panel2.add("checkbox"); | |
checkbox2.text = "JPEG"; | |
checkbox2.value = true; | |
var checkbox3 = panel2.add("checkbox"); | |
checkbox3.text = "PNG"; | |
var checkbox4 = panel2.add("checkbox"); | |
checkbox4.text = "PSD"; | |
var checkbox5 = panel2.add("checkbox"); | |
checkbox5.text = "PDF"; | |
var checkbox6 = panel2.add("checkbox"); | |
checkbox6.text = "TIFF"; | |
// GROUP6 | |
// ====== | |
var group6 = dialog.add("group"); | |
group6.orientation = "row"; | |
group6.alignChildren = ["left","top"]; | |
group6.spacing = 10; | |
group6.margins = 0; | |
var button1 = group6.add("button"); | |
button1.text = "Cancel"; | |
button1.justify = "center"; | |
var button2 = group6.add("button"); | |
button2.text = "Save"; | |
button2.justify = "center"; | |
dialog.show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment