Multiple radiobutton.values in CS2

Discussion of actual or possible Photoshop Scripting Bugs, Anomalies and Documentation Errors

Moderators: Tom, Kukurykus

Sen

Multiple radiobutton.values in CS2

Post by Sen »

I have an array of radiobuttons generated by a loop. One radiobutton is initialized as default value when opening the dialog box:
Code: Select allrbTyp[0].value = true;

When I loop through the array to check for true values, Photoshop CS2 is giving back 2 true values. The default button and the user selected button. This is very weird because in the dialog box there’s just one button selected.

Photoshop CS is acting normally and just gives back one true value (the user selected).

How can I solve this for CS2?
Andrew

Multiple radiobutton.values in CS2

Post by Andrew »

Hi Sen

Radio-buttons are buggy in CS2. Generally if you wrap them up either in a panel or a goup with nothing else in there they work, otherwise there can be problems. Above all do not have two sets of radio buttons in the same dialog parent. There was some discussion about it at the Adobe forum when CS2 first came out.

Andrew
Sen

Multiple radiobutton.values in CS2

Post by Sen »

Andrew,

Thank you for your reply. It seems as you predicted that removing the image object from the loop solves the double values in rbTyp.
Sadly my UI is broken now... Will there be an update any soon to correct this problem?

Code: Select all   // Border type panel
   setDlg.borderTypPanel = setDlg.add('panel', undefined, panelTxt[1]);
   setDlg.borderTypPanel.preferredSize = [592, 0];
   setDlg.borderTypPanel.orientation = 'row';
   var i = 0;

   while (i < rbTyp.length) {
      rbTyp = setDlg.borderTypPanel.add('radiobutton');
      setDlg.borderTypPanel.add('image', undefined, imgRoot + rbTypTxt + '.png');
      i++;
   }

// Update:
Fixed around the problem with some logic, removing the double value and leaving the UI intact.