Copy link to clipboard
Copied
I'm wanting the Pic to change depending on what Radio button i have selected. Is this possible with Indesign scripting?
- // How can i make PreV1 activate the below Radio buttons? Maybe gray out the Buttons when not the Check box is not checked.
- var PreV1= w.tabs[2].add ('checkbox {text: "To Preview Changes"}');
- var Pan1=w.tabs[2].add ('panel {text: "", preferredSize: [-1, 200],orientation: "column",alignChildren: ["left","top"]}');
- // Is there a way to make each radio button display a Different Pictrue?
- Pan1.add('radioButton {text: "B1. Enter Here1"}');
- Pan1.add('radioButton {text: "B2. Enter Here2"}');
- Pan1.add('radioButton {text: "B3. Enter Here3"}');
- Pan1.add('radioButton {text: "B4. Enter Here4"}');
- Pan1.add('radioButton {text: "B1. Enter Here5"}');
- Pan1.add('radioButton {text: "B2. Enter Here6"}');
- Pan1.add('radioButton {text: "B3. Enter Here7"}');
- Pan1.add('radioButton {text: "B4. Enter Here8"}');
- Image.prototype.onDraw =function()
- {
- if(!this.image )return;
- var WH =this.size,wh =this.image.size,k = Math.min(WH[0]/wh[0], WH[1]/wh[1]), xy;
- wh =[k*wh[0],k*wh[1]];
- xy =[(WH[0]-wh[0])/2, (WH[1]-wh[1])/2 ];
- this.graphics.drawImage(this.image,xy[0],xy[1],wh[0],wh[1]);
- WH = wh = xy =null;
- }
- flower=w.tabs[2].add ("image", undefined, File ("~/\Desktop/\xxx.jpg"));
- flower.size =[300,300];
- for(
- var i = 0;
- i < w.tabs.length;
- i++){
- w.tabs.orientation ='column';
- w.tabs.alignChildren ='fill';
- w.tabs.alignment =['fill','fill'];
- w.tabs.visible =false;
- }
- w.stubs.onChange = showTab;
- function
- showTab ()
- {
- if(w.stubs.selection !==null){for(var i = w.tabs.length-1; i >= 0;
- i--)
- {
- w.tabs.visible =false;
- }
- w.tabs[w.stubs.selection.index].visible =true;
- }
- }
- w.onShow =function()
- {
- w.stubs.selection = 1;
- showTab;
- }
- myResult = w.show();
Copy link to clipboard
Copied
am i on the right path? I turned off the lower radio buttons to give me more room to play with.
radioButton = Pan1.add ('radioButton {text: "Pic1"}')
- Image.prototype.onDraw =function(){
- if(!this.image )return;
- var WH =this.size,wh =this.image.size,k = Math.min(WH[0]/wh[0], WH[1]/wh[1]), xy;
- wh =[k*wh[0],k*wh[1]];
- xy =[(WH[0]-wh[0])/2, (WH[1]-wh[1])/2 ];
- this.graphics.drawImage(this.image,xy[0],xy[1],wh[0],wh[1]);
- WH = wh = xy =null;}
- flower=w.tabs[2].add ("image", undefined, File ("~/\Desktop/\xxx.jpg"));
- flower.size =[300,300];
- /*
- Pan1.add('radioButton {text: "B2. Enter Here2"}');
- Pan1.add('radioButton {text: "B3. Enter Here3"}');
- Pan1.add('radioButton {text: "B4. Enter Here4"}');
- Pan1.add('radioButton {text: "B1. Enter Here5"}');
- Pan1.add('radioButton {text: "B2. Enter Here6"}');
- Pan1.add('radioButton {text: "B3. Enter Here7"}');
- Pan1.add('radioButton {text: "B4. Enter Here8"}');
- */
Copy link to clipboard
Copied
I should mention that this preview will be on the UI of my script.
Copy link to clipboard
Copied
Find more inspiration, events, and resources on the new Adobe Community
Explore Now