The block of script below, I have a button that has an onClick function. When it is pressed, An Open dialog will open and when the use selects a file, the path of that file selected is returned in a text box. (Not included in the script) I have a few other values that need to be entered by the user before the script can continue. At the bottom of the dialog, I have an OK button. When the Ok button is pressed, I want the script to open the file at that particular time, not when it is selected from the open dialog. It works if I open the file after I browse for it with the open dialog, but to do it later in a different function is what I am having trouble with. I am new at Scripting for Adobe apps. Can someone help me out please? Thank you.
var stPath;
defineVars.STPnl.STBrowse.onClick = function browseST() {
var stbFile = File.openDialog("Select the Single Mugshot Key Template File", "PSD File:*.psd");
if (stbFile.fullName == null) {
//Take no action
}
else {
defineVars.STPnl.STPath.text = stbFile.fullName;
stPath = defineVars.STPnl.STPath.text;
//open(stbFile); (Doing it this way works, but I don't want it to execute in this sequence)
}
}