Skip to main content
Known Participant
February 24, 2018
Answered

to run a script when opening a dialog box?

  • February 24, 2018
  • 1 reply
  • 1372 views

I intend to improvise here a kind of window that shows only a message "PROCESSING .... WAIT!" when executing a task through a script. The window has to be of the "Dialog" type and not "Palette" I hate palettes.

It will work this way:

First open the window and then automatically run the main event without closing the window ..... after completing the whole process would execute this line: Dlg.close ();

I do not know if this is crazy of me, but I believe there is some specialist who can show me some possibility.

This topic has been closed for replies.
Correct answer r-bin

Type "window" is not suitable instead of "palette"?

var d = new Window("window", "", undefined, {maximizeButton:false, minimizeButton:false, closeButton:true} );

d.add("statictext", undefined, "PROCESSING .... WAIT!");

d.show()

//some comde

//for (var i = 0; i < 100; i++)  activeDocument.activeLayer = activeDocument.layers

d.close()

1 reply

r-binCorrect answer
Legend
February 25, 2018

Type "window" is not suitable instead of "palette"?

var d = new Window("window", "", undefined, {maximizeButton:false, minimizeButton:false, closeButton:true} );

d.add("statictext", undefined, "PROCESSING .... WAIT!");

d.show()

//some comde

//for (var i = 0; i < 100; i++)  activeDocument.activeLayer = activeDocument.layers

d.close()

Ps-DesignAuthor
Known Participant
February 25, 2018

Sorry for the delay!

This really worked very well! Great idea r-bin

Thank you!

Legend
February 25, 2018

Just in CC2018 (on win7 at least) does not work very well. The control flags of the window buttons are ignored. (