Photoshop Dropdown List Question:
I am trying to add a dropdown list whereby the user can change the units to either INCHES or CM
listStrings = ["INCHES", "CM"];
myDlg = new Window('dialog', 'Drop-down List');
myDlg.orientation = 'column';
myDlg.alignment = 'right';
//add drop-down
myDlg.DDgroup = myDlg.add('group');
myDlg.DDgroup.orientation = 'row';
myDlg.DDgroup.add('statictext', undefined, "Unit Measurements");
myDlg.DDgroup.DD = myDlg.DDgroup.add('dropdownlist', undefined, undefined, {items:listStrings})
myDlg.DDgroup.DD.selection = 4;
myDlg.closeBtn = myDlg.add('button', undefined, 'OK');
result = myDlg.show();
app.preferences.rulerUnits = Units.myDlg.DDgroup.DD.selection
// add button functions
myDlg.closeBtn.onClick = function() {
this.parent.close();
}
it works to some degree but Photoshop seems to hang and become unresponsive after pressing the button. Ideally I would prefer the units to change from the dropdown list selection rather than having to press the button.
Any advice please