Auto place dialog window on the right side

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

ddbell

Auto place dialog window on the right side

Post by ddbell »

Is there an easy way to have a dialog window auto aligned to the right side of the screen regardless of screen resolution (preferably the upper right corner)? It seems that there should be something built in to do this but I can't seem to figure it out.

Thanks
User avatar
Kukurykus
Posts: 528
Joined: Mon Jul 25, 2016 12:36 pm

Re: Auto place dialog window on the right side

Post by Kukurykus »

As you please... (tested in CS2 & CS5.1) and here's excellent respasitory: http://www.kahrel.plus.com/indesign/scriptui.html

Code: Select all

dlg = false, wi = null, he = null;
(function loop() {
win = new Window (dlg ? 'dialog' : 'palette');
(wi && he) ? win.frameLocation = [String($.screens).match(/\d{4}/) - wi, 0] : win.center();
win.add ('statictext {text: "This is your dialog window in right upper corner."}')
grp = win.add('group'); grp.add("button", [0,0,28,19], "OK", {name: 'close'})
if (!dlg) win.show(), win.close(), wi = win.size[0], he = win.size[1], dlg = true, loop()
else win.show()
})()
Attachments
Dialogue Box Position.zip
(609 Bytes) Downloaded 311 times