script ui question

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

tyr

script ui question

Post by tyr »

Hello,
I have a question regarding the Script UI
Does anyone know if it's possible make a button above an image with Script UI? Like using a background image, or something similar to absolute positioning in html?



Many thanks!

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

c.buliarca

script ui question

Post by c.buliarca »

You can use the 'stack' option like this:

Code: Select allfunction mainUI(){
   var win = new Window( 'dialog', 'testUI' ,undefined,{resizeable:true,closeButton:true,borderless:false});
      win.g0 = win.add('group');
         win.g0.orientation = 'stack';
         if(parseInt(app.version) > 11){// if is not cs4
            win.img = win.g0.add('image', undefined, new File( Folder.desktop + "/grad.png"));
         }
         win.g1 = win.g0.add('group');
         if(parseInt(app.version) <= 11){// if is cs4
            g = win.g1.graphics;
              var myBrush = g.newBrush(g.BrushType.SOLID_COLOR, [0.1, 0.1, 0.1, 0]);
              g.backgroundColor = myBrush;
           }
            win.orientation = 'row';
            win.bt1 = win. g1.add('button', undefined, 'ok');
            win.bt2 = win.g1.add('button', undefined, 'cancel');
         if(parseInt(app.version) <= 11){// if is cs4
            win.img = win.g0.add('image', undefined, new File( Folder.desktop + "/grad.png"));
         }

   win.show();
}

mainUI();
tyr

script ui question

Post by tyr »

Thanks Cristian, works perfectly!
tyr

script ui question

Post by tyr »

Actually, I have another similar question, is there a way to use html in scriptUI dialogue window in the same fashion the scriptUI can use flashplayer?
c.buliarca

script ui question

Post by c.buliarca »

I don't see anything about integrating html into the ScriptUI in the docs.....It would have been a nice feature