Skip to main content
johnt53984649
Inspiring
October 16, 2016
Question

Custom Prompt Box

  • October 16, 2016
  • 3 replies
  • 3653 views

Is it possible to create a custom prompt that contains multiple text fields and checkboxes, each of which correspond to setting values of certain variables in a script that should then be continued once an "Okay" button is pressed?  Here's an example drawing of what I'm looking for.

After activating the script, the following prompt should pop up:

After making selections and entering values and pressing okay, the values of variables in my script should change based upon what was entered into the prompt.  Then the rest of the script should then be executed.

How could I create such a prompt?

This topic has been closed for replies.

3 replies

johnt53984649
Inspiring
October 18, 2016

Thanks for the advice everybody.

I've been looking around for some sample code and I'm getting somewhat confused.  Some code appears as all red in extendscript while other types still color code certain aspects of the script.  For example, compare:

http://prntscr.com/cvoc93

to

http://prntscr.com/cvocbm

So the syntax is noticeably different between these two and I'm not sure I understand the advantages of either.  I'm leaning toward the first example because it's much easier to read but, for example, I cannot figure out how to create a dropdown box in the first example while it's clear how to in the second one.

JJMack
Community Expert
Community Expert
October 18, 2016

I do not use the ectendscript toolkit to edit develop and test scripts. I do not like how all the window contents seem to jump around and had problem with it where scripts that worked in Photoshop did not work when run in the extendscript toolkit.

Most of my dialogs are created bo copy paste form example fond in this forum and scripts I have downloaded from the web and the scripts that ship with Photoshop.. I change to suite my needs.

Drop down list consisted of and array of interns and a index into that list.  Here I so code I used for placement list and font list. In my collages populating dialogs.

dlg.msgPnl.grp5a =dlg.msgPnl.add('group');

dlg.msgPnl.grp5a.orientation='row';

dlg.msgPnl.grp5a.alignment='fill';

dlg.msgPnl.grp5a.st1 = dlg.msgPnl.grp5a.add('statictext',undefined,'Name Stamp Text  Location:');

var position =['Top Left','Top Center','Top Right','Center Left','Center','Center Right','Bottom Left','Bottom Center','Bottom Right'];

dlg.msgPnl.grp5a.dd1 = dlg.msgPnl.grp5a.add('dropdownlist',undefined,position);

dlg.msgPnl.grp5a.dd1.selection=textLocationDefault;

dlg.msgPnl.grp6a =dlg.msgPnl.add('group');

dlg.msgPnl.grp6a.orientation='row';

dlg.msgPnl.grp6a.alignment='fill';

dlg.msgPnl.grp6a.st1 = dlg.msgPnl.grp6a.add('statictext',undefined,'Font');

fontlist = new Array();

for (var i=0,len=app.fonts.length;i<len;i++) {

   fontlist =  app.fonts.name;

}

dlg.msgPnl.grp6a.dd1 = dlg.msgPnl.grp6a.add('dropdownlist',undefined,fontlist);

dlg.msgPnl.grp6a.dd1.selection=1;

JJMack
Chuck Uebele
Community Expert
Community Expert
October 18, 2016

Yes, as JJ mentioned, read up on it in the JavaScript Tools Guide. But here's an example: