ScriptUI run script from dialog button
Here is what I have right now. It is a little clunky in the way it works, and I would just like to make it a bit slicker.
I have a script on startup that creates a Menu item with a dropdown submenu item. when you click on the submenu item, it starts a script.
The first thing the script does is pop up a message box that tells them that two dialog boxes are going to popup. The first one asking them to choose the location of an xml file and the second dialog box that ask them to choose the location of their image folder. After they finish choosing their folder in the second dialog, the script takes those two values, makes them variables, and continues to run the rest of the script.
Here is what I would like it to do..
1. open a dialog window with two input fields, two "browse" buttons, and OK and CANCEL buttons
2. when you click the first browse button next to the first input field, it will open a file dialog window. You select your file and the file string will populate the input field
3. when you click the second button next to the second input field, it opens a folder dialog window. You select the folder and the string populates the second input field.
4. when you click OK, it feeds the values in the input fields to a script.
I already have scripts to that open the file and folder dialogs, but what I can't figure out how to do is to start and run a script from a button press, in this case, when the OK button is pressed. It is probably an onClick, but I haven't been able to find any examples of what the syntax would be.
The closest I have found is in the Beginning ScriptUI document that was on Jongware's site, in the section on Communication between windows. But that opens each of the windows with a different script and not using a button press to call a script.
As always, any point in the right direction is very much appreciated. thanks.
