Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #target photoshop
- app.bringToFront();
- var ui = //dialog resource object
- "dialog { \
- alignChildren: 'fill', \
- pFiles: Panel { \
- orientation: 'column', alignChildren:'left', \
- text: 'Source/Destination', \
- g1: Group { \
- orientation: 'row', alignChildren: 'left', \
- display: StaticText { text:'Source Images Files or Folder: ' }, \
- src: DropDownList {alignment: 'left'}, \
- choose: Button { text: 'Choose' } \
- }, \
- g2:Group { \
- orientation: 'row', alignChildren: 'left', \
- display: StaticText { text:'Output Folder: ' }, \
- choose: Button { text: 'Choose' } \
- }, \
- }, \
- pResize: Panel { \
- orientation: 'column', alignChildren: 'left', \
- text: 'Resize Options', \
- g1: Group { \
- orientation: 'column', alignChildren: 'left', \
- axis: RadioButton { text: 'Resize by Longest Axis' }, \
- resize: RadioButton { text: 'Resize Both Axes' }, \
- }, \
- g2: Group { \
- orientation: 'row', alignChildren: 'left', \
- display: StaticText { text: 'Enter Value for Longest Axis: ' }, \
- axisTxt: EditText { bounds: [ 0, 0, 60, 21 ] }, \
- }, \
- g3: Group { \
- orientation: 'row', alignChildren: 'left', \
- displayX: StaticText { text: 'Width: ' }, \
- resizeX: EditText { bounds: [ 0, 0, 60, 21 ] }, \
- displayY: StaticText { text: 'Height: ' }, \
- resizeY: EditText { bounds: [ 0, 0, 60, 21 ] }, \
- }, \
- g4: Group { \
- orientation: 'row', alignChildren: 'left', \
- displayCB: Checkbox{ text: 'Resize Canvas' }, \
- }, \
- g5: Group { \
- orientation: 'row', alignChildren: 'left', \
- displayX: StaticText { text: 'Width: ' }, \
- resizeX: EditText { bounds: [ 0, 0, 60, 21 ] }, \
- displayY: StaticText { text: 'Height: ' }, \
- resizeY: EditText { bounds: [ 0, 0, 60, 21 ] }, \
- }, \
- }, \
- pExport: Panel { \
- orientation: 'column', alignChildren: 'left', \
- text: 'Export Options', \
- g1: Group { \
- orientation: 'column', alignChildren: 'left', \
- exportPSD: Checkbox{ text: 'Export PSD' }, \
- exportWeb: Checkbox{ text: 'Export for Web (jpeg)' }, \
- exportToLayer: Checkbox{ text: 'Export to Layers' }, \
- exportLayer: Checkbox{ text: 'Export Layers for Web (jpeg)' }, \
- }, \
- }, \
- pForWeb: Panel { \
- orientation: 'column', alignChildren: 'left', \
- text: 'Export for Web Options', \
- g1: Group { \
- orientation: 'row', alignChildren: 'left', \
- colorPick: Button { text: 'Matte Color' }, \
- qualTxt: StaticText{ text: 'Quality: ' }, \
- qualEntry: EditText { bounds: [ 0, 0, 30, 21 ] }, \
- qualPer: StaticText{ text: '%' }, \
- }, \
- }, \
- gButtons:Group { \
- orientation: 'row', alignment: 'right', \
- okButn: Button { text:'Ok', properties: {name:'ok'} }, \
- cancelBtn: Button { text:'Cancel', properties: {name:'cancel'} } \
- } \
- }";
- var win = new Window( ui );
- var srcDrop = win.pFiles.g1.src;
- var srcBtn = win.pFiles.g1.choose;
- var destBtn = win.pFiles.g2.choose;
- var axisRBtn = win.pResize.g1.axis;
- var resizeRBtn = win.pResize.g1.resize;
- var axisTxt = win.pResize.g2;
- var resizeTxt = win.pResize.g3;
- var canvasCB = win.pResize.g4.displayCB;
- var canvasTxt = win.pResize.g5;
- var colorBtn = win.pForWeb.g1.colorPick;
- srcBtn.visible = false;
- axisTxt.visible = false;
- resizeTxt.visible = false;
- canvasTxt.visible = false;
- srcDrop.add( 'item', 'File' );
- srcDrop.add( 'item', 'Folder' );
- srcDrop.onChange = function() {
- var curr = this.selection;
- //$.write( curr );
- if( curr != null && srcBtn.visible == false ){
- srcBtn.visible = true;
- }
- }
- axisRBtn.onClick = function() {
- axisTxt.visible = true;
- resizeTxt.visible = false;
- //var testTxt = axisTxt.add( 'statictext', [0, 0, 80, 21], 'test' );
- }
- resizeRBtn.onClick = function() {
- axisTxt.visible = false;
- resizeTxt.visible = true;
- }
- canvasCB.onClick = function(){
- canvasTxt.visible = this.value;
- }
- colorBtn.onClick = function(){
- var mycolor = $.colorPicker (0xffffff);
- $.write( mycolor.toString(16) );
- }
- //$.write("ugh");
- win.show();
Advertisement
Add Comment
Please, Sign In to add comment