Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

More Scripting Help needed please.

Advisor ,
May 05, 2016 May 05, 2016

Ok the below Script is what i would like to use for what i'm doing.  I have alot that i'm going to add to it over time so i'm hoping you can help with some of these Questions.  I have all the things i want to do marked with //.  We can just do one section at a time if you would like to make the scripting easier or all at one time it dont matter to me.  I'm very new to scripting so this could take me a while to do. 

   

    var w =new Window ('dialog {text: "Running Changes", orientation: "column", alignChildren:["fill","fill"],   properties:   {closeButton:   false}}');

      w.main =w.add ('group {preferredSize: [600, 500], alignChildren: ["left","fill"]}');

      w.stubs  = w.main.add ('listbox', undefined, ['Changes Made', 'Check For Changes', 'Example']);

    w.stubs.preferredSize.width  = 150;  w.tabGroup  = w.main.add ('group {alignment: ["fill","fill"], orientation: "stack"}');

      w.tabs  =[];

    w.tabs[0]= w.tabGroup.add ('group');

    w.tabs[0].add('statictext {text: "Changed"}');

               w.tabs  =[];

    w.tabs[0]= w.tabGroup.add ('group');

    w.tabs[0].add('statictext {text: "Select a change to make"}');

             w.tabs[0].add ('panel');

             w.tabs[0].add ('checkbox {text: "Run Running Change List1"}');// Activate the Find and replace Script

            

//~              IF possible i would this script to be exicuted if the above check mark is selected. After pressing OK button

//~              if this button is not selected i dont wnat this part of the script to activate.

             //~     Replace(" <CR> ", "^p") 

                    //~     Replace("  ", " ")

                    //~     Replace(" :", ":")

                    //~     Replace(" .", ".")

                    //~     Replace("^p^p", "^p")

                    //~     Replace(" <CR>", "^p")

                    //~    

                    //~   

                    //~ 

                    //~         function Replace(input, output) 

                    //~         { 

                    //~             app.selection[0]; 

                    //~             app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing; 

                    //~             app.findTextPreferences.findWhat = input; 

                    //~             app.changeTextPreferences.changeTo = output; 

                    //~             app.activeDocument.changeText(); 

                    //~           

                    //~  

     

             w.tabs[0].add ('checkbox {text: "Running Change list 2"}');

             w.tabs[0].add ('panel {text: "Running CHange list 1", preferredSize: [-1, 160]}');

             w.tabs[0].add ('panel {text: "Running CHnage list 2", preferredSize: [-1, 160]}');

                    // I would like a list inside this panel

                   

                    //~  "B1.   Omni Align Front panel information to the O in omni"

                    //~  "B2.   ShopLine Align Front panel text with S in Shop and Identifier with L in line Flush Left text

                    //~  "B3.   Deltron Spacing around Art and logo

                    //~  "B4.   Matthews Art and Attribute statement update

                    //~  "B5.   One Shot Artwork (Some change to Just green bar Some Blue ETC...

  

  

                   

             w.tabs[0].add ('panel {text: "NON Changes to be made", preferredSize: [-1, 150]}');

             w.tabs[0].add ('panel {text: "When placing or pasting content", preferredSize: [-1, 80]}');

    with(w.tabs[0])

    {

    with(add ('group {alignment: "left"}'))

    {

                   add ('button {text: "Reset al warning dialogs"}');

    }

    }

    w.tabs[1]= w.tabGroup.add ('group');

             w.tabs[1].add ('statictext {text: "Interface"}');

             w.tabs[1].add ('panel {preferredSize: [-1, -10]}');

             w.tabs[1].add ('panel {text: "What Needs Changed", preferredSize: [-1, 300]}');

                     

             w.tabs[1].add ('panel {text: "Options", preferredSize: [-1, 100]}');

    w.tabs[2]= w.tabGroup.add ('group');

             w.tabs[2].add ('statictext {text: "UI Scaling"}');

             w.tabs[2].add ('panel');

             w.tabs[2].add ('panel {text: "Example", preferredSize: [-1, 200]}');

            

            

             // I would like to embed a Picture in the Example BOx

            

            

      w.buttons  = w.add ('group {alignment: "right"}');

    w.buttons.add  ('button {text: "OK"}');

    w.buttons.add  ('button {text: "Cancel"}');

    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;

    }

    w.show();

TOPICS
Scripting
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , May 05, 2016 May 05, 2016

try this.. see the line 58.. do that and run the script

var myResult;

var w =new Window ('dialog {text: "Running Changes", orientation: "column", alignChildren:["fill","fill"],   properties:   {closeButton:   false}}');

      w.main =w.add ('group {preferredSize: [600, 500], alignChildren: ["left","fill"]}');

      w.stubs  = w.main.add ('listbox', undefined, ['Changes Made', 'Check For Changes', 'Example']);

    w.stubs.preferredSize.width  = 150;  w.tabGroup  = w.main.add ('group {alignment: ["fill

...
Translate
Guide ,
May 05, 2016 May 05, 2016

try this.. see the line 58.. do that and run the script

var myResult;

var w =new Window ('dialog {text: "Running Changes", orientation: "column", alignChildren:["fill","fill"],   properties:   {closeButton:   false}}');

      w.main =w.add ('group {preferredSize: [600, 500], alignChildren: ["left","fill"]}');

      w.stubs  = w.main.add ('listbox', undefined, ['Changes Made', 'Check For Changes', 'Example']);

    w.stubs.preferredSize.width  = 150;  w.tabGroup  = w.main.add ('group {alignment: ["fill","fill"], orientation: "stack"}');

      w.tabs  =[];

    w.tabs[0]= w.tabGroup.add ('group');

    w.tabs[0].add('statictext {text: "Changed"}');

               w.tabs  =[];

    w.tabs[0]= w.tabGroup.add ('group');

    w.tabs[0].add('statictext {text: "Select a change to make"}');

             w.tabs[0].add ('panel');

    var RunCH1= w.tabs[0].add ('checkbox {text: "Run Running Change List1"}');// Activate the Find and replace Script

           

//~              IF possible i would this script to be exicuted if the above check mark is selected. After pressing OK button

//~              if this button is not selected i dont wnat this part of the script to activate.

           

    

             var RunCH2= w.tabs[0].add ('checkbox {text: "Running Change list 2"}');

             var Pan1=w.tabs[0].add ('panel {text: "Running Change list 1", preferredSize: [-1, 160],orientation: "column",alignChildren: ["left","fill"]}');

             w.tabs[0].add ('panel {text: "Running Change list 2", preferredSize: [-1, 160]}');

            Pan1.add('statictext {text: "B1.   Omni Align Front panel information to the O in omni"}');

            Pan1.add('statictext {text: "B2.   ShopLine Align Front panel text with S in Shop and Identifier with L in line Flush Left text"}');

            Pan1.add('statictext {text: "B3.   Deltron Spacing around Art and logo"}');

            Pan1.add('statictext {text: "B4.   Matthews Art and Attribute statement update"}');

            Pan1.add('statictext {text: "B5.   One Shot Artwork (Some change to Just green bar Some Blue ETC..."}');

                    // I would like a list inside this panel

       

 

 

                  

             w.tabs[0].add ('panel {text: "NON Changes to be made", preferredSize: [-1, 150]}');

             w.tabs[0].add ('panel {text: "When placing or pasting content", preferredSize: [-1, 80]}');

    with(w.tabs[0])

    {

    with(add ('group {alignment: "left"}'))

    {

                   add ('button {text: "Reset al warning dialogs"}');

    }

    }

        w.tabs[1]= w.tabGroup.add ('group');

        w.tabs[1].add ('statictext {text: "Interface"}');

        w.tabs[1].add ('panel {preferredSize: [-1, -10]}');

        w.tabs[1].add ('panel {text: "What Needs Changed", preferredSize: [-1, 300]}');

                    

        w.tabs[1].add ('panel {text: "Options", preferredSize: [-1, 100]}');

        w.tabs[2]= w.tabGroup.add ('group');

        w.tabs[2].add ('statictext {text: "UI Scaling"}');

        w.tabs[2].add ('panel');

        w.tabs[2].add ('panel {text: "Example", preferredSize: [-1, 200]}');

        flower=w.tabs[2].add ("image", undefined, File ("~/\Desktop/\xxx.jpg"));//place you image in desktop and put the image name in the place of "xxx"

           

             // I would like to embed a Picture in the Example BOx

           

           

      w.buttons  = w.add ('group {alignment: "right"}');

     w.buttons.add  ('button {text: "OK"}');

    w.buttons.add  ('button {text: "Cancel"}');

    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();

    if(myResult == 1 && (RunCH1.value==true || RunCH2.value==true) ){ 

    alert("in")

    Replace_TXT(" <CR> ", "^p");

    Replace_TXT("  ", " ");

    Replace_TXT(" :", ":");

    Replace_TXT(" .", ".");

    Replace_TXT("^p^p", "^p");

    Replace_TXT(" <CR>", "^p");

    w.close (true);

}  

function Replace_TXT(input, output)

{

//app.selection[0];

app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;

app.findTextPreferences.findWhat = input;

app.changeTextPreferences.changeTo = output;

app.activeDocument.changeText();

}

   

   

   

   

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 06, 2016 May 06, 2016

First thing You are Awesome!  And this is starting to act just like i want it to now.  I have a few other things I am trying to do with this script.  If i cannot figure them out i will be back on here for your help.  Thank you so much for all your doing.  Your saving me a ton of frustration.  This is getting close to being exactly what i'm needing.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
May 06, 2016 May 06, 2016

Glad to help you

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 06, 2016 May 06, 2016

I have a few more questions that i cannot figure out.  Also how do you get your code to display with the numbered lines on this site?

var myResult;

var w =new Window ('dialog {text: "Running Changes", orientation: "column", alignChildren:["fill","fill"],   properties:   {closeButton:   false}}');

   w.main =w.add ('group {preferredSize: [600, 600], alignChildren: ["left","fill"]}');

    w.stubs  = w.main.add ('listbox', undefined, ['Changes Made', 'Check For Changes', 'Example']);

    w.stubs.preferredSize.width  = 120;  w.tabGroup  = w.main.add ('group {alignment: ["Fill","Fill"], orientation: "stack"}');

        w.tabs  =[];

            w.tabs[0]= w.tabGroup.add ('group');

            w.tabs[0].add('statictext {text: ""}');

        w.tabs  =[];

            w.tabs[0]= w.tabGroup.add ('group');

            w.tabs[0].add('statictext {text: "Select a change to make"}');

        w.tabs[0].add ('panel');

// I cannot figure out how to make RunCH2 and 3 to Work. Example bleow '

/*

RunCH2

  alert("RCH2 DONE")

            Replace_TXT(" and ", "dddd");

         

          

RunCH3

  alert("RCH3 DONE")

            Replace_TXT(" The ", " blah blah");

         

*/

    var RunCH1= w.tabs[0].add ('checkbox {text: "Find and Replace"}');

    var RunCH2= w.tabs[0].add ('checkbox {text: "GHS Running Changes"}');

    var RunCH3= w.tabs[0].add ('checkbox {text: "Non-GHS Running Changes"}');       

     

             

             var Pan1=w.tabs[0].add ('panel {text: "Find and Replace", preferredSize: [-1, 200],orientation: "column",alignChildren: ["left","Center"]}');

          

                Pan1.add('statictext {text: "Double Space   -   Single Space"}');

                Pan1.add('statictext {text: "Space :    -   :"}');

                Pan1.add('statictext {text: "Space .    -   ."}');

                Pan1.add('statictext {text: "<CR>   -   Return"}');

                Pan1.add('statictext {text: "Double Return  -   Return"}');

                   

            

             var Pan1=w.tabs[0].add ('panel {text: "GHS Running Changes", preferredSize: [-1, 150],orientation: "column",alignChildren: ["left","Center`"]}');

           

                Pan1.add('statictext {text: "B1.   Enter Here1"}');

                Pan1.add('statictext {text: "B2.   Enter Here2"}');

                Pan1.add('statictext {text: "B3.   Enter Here3"}');

                Pan1.add('statictext {text: "B4.   Enter Here4"}');

         

         

          

            var Pan1=w.tabs[0].add ('panel {text: "Non-GHS Running Changes", preferredSize: [-1, 150],orientation: "column",alignChildren: ["left","Center`"]}');

           

                Pan1.add('statictext {text: "B1.   Enter Here5"}');

                Pan1.add('statictext {text: "B2.   Enter Here6"}');

                Pan1.add('statictext {text: "B3.   Enter Here7"}');

                Pan1.add('statictext {text: "B4.   Enter Here8"}');

 

             var Pan1=w.tabs[0].add ('panel {text: "Contact Infromation", preferredSize: [-1, 62],orientation: "column",alignChildren: ["left","Center`"]}');

           

// How would I add a email address here where my co-workers could Click it email about Whatever?  This is not as big of a deal so if this is alot of trouble to do i will skip it.

                Pan1.add('statictext {text: "*email Address here*"}');

               

         

    with(w.tabs[0])

    {

    with(add ('group {alignment: "left"}'))

    {

                   add ('button {text: "Reset all warning dialogs"}');

    }

    }

        w.tabs[1]= w.tabGroup.add ('group');

        w.tabs[1].add ('statictext {text: "Changes that WILL need checked"}');

        w.tabs[1].add ('panel {preferredSize: [-1, -10]}');

        var Pan1=w.tabs[1].add ('panel {text: "GHS", preferredSize: [-1, 250],orientation: "column",alignChildren: ["left","Center`"]}');

           

                Pan1.add('statictext {text: "B1.   Here"}');

                Pan1.add('statictext {text: "B2.   Here"}');

                Pan1.add('statictext {text: "B3.   Here"}');

                Pan1.add('statictext {text: "B4.   Here"}');

                Pan1.add('statictext {text: "B5.   Here"}');

                Pan1.add('statictext {text: "G1.   Here"}');

                Pan1.add('statictext {text: "G2.   Here"}');

                     

        w.tabs[1].add ('panel {text: "Non-GHS", preferredSize: [-1, 100]}');

        w.tabs[2]= w.tabGroup.add ('group');

        w.tabs[2].add ('statictext {text: "Example Of running Changes"}');

        w.tabs[2].add ('panel');

        w.tabs[2].add ('statictext {text: "", preferredSize: [-1, 20]}');

      

  // 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];

          

 

            

      w.buttons  = w.add ('group {alignment: "right"}');

     w.buttons.add  ('button {text: "OK"}');

    w.buttons.add  ('button {text: "Cancel"}');

    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(); 

// How do i make each CHECK BOX RunCH1/2/3 Only work when they are selected?  I cannot figure out how to make 2&3 Work.

    if(myResult == 1 && (RunCH1.value==true || RunCH2.value2==true || RunCH3.value3==true) ){  

        alert("Changes have been made!")

            Replace_TXT(" <CR> ", "^p");

            Replace_TXT("  ", " ");

            Replace_TXT(" :", ":");

            Replace_TXT(" .", ".");

            Replace_TXT("^p^p", "^p");

            Replace_TXT(" <CR>", "^p");

       w.close (true);

   /*  

    

    if(myResult == 2 && (RunCH2.value==true) 

        alert("RunCH2 DONE")

            Replace_TXT(" and ", "dddd");

      w.close (true);    

     if(myResult == 3 && (RunCH3.value==true)     

        alert("RunCH3 DONE")

            Replace_TXT(" The ", " blah blah");

            w.close (true);

   */

     {

}

}

function Replace_TXT(input, output) 

//app.selection[0]; 

app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing; 

app.findTextPreferences.findWhat = input; 

app.changeTextPreferences.changeTo = output; 

app.activeDocument.changeText(); 

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 06, 2016 May 06, 2016

Ok i kinda have the Check box search going.  Let me know what i'm doing wrong.  If i select the "RunCH1" CHeck box it will replace all those values.  If i Select just the RunCH2 Check box it does RunCH1 and RunCH2.  and if i select just the RunCH3 box it RunCH1 and RunCH3 work.  and if i select them all they all work to gether.  Here's the code i used.  I am assuming its because all 3 are in that first line of code.  BUt if i delete the CH2 and 3 from the first line nothing happens when i click the check box for them.

/ How do i make each CHECK BOX RunCH1/2/3 Only work when they are selected?  I cannot figure out how to make 2&3 Work.

    if(myResult == 1 && (RunCH1.value==true || RunCH2.value==true || RunCH3.value==true) ){ 

        alert("Changes have been made!")

            Replace_TXT(" <CR> ", "^p");

            Replace_TXT(" <CR>", "^p");

            Replace_TXT("  ", " ");

            Replace_TXT(" :", ":");

            Replace_TXT(" .", ".");

            Replace_TXT("^p^p", "^p");

           

          

        if(myResult == 1 && (RunCH2.value==true) ){  

            Replace_TXT("test", "asdfasdfasdfadsfasdfasdfasdfadfasdfasdf");

    }

   

        if(myResult == 1 && (RunCH3.value==true) ){ 

            Replace_TXT("and", "TEST");

        w.close(true);    

       

     }

}

function Replace_TXT(input, output)

{

//app.selection[0];

app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;

app.findTextPreferences.findWhat = input;

app.changeTextPreferences.changeTo = output;

app.activeDocument.changeText();

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 06, 2016 May 06, 2016

There was another potential problem.  How can i make this search for case sensitive characters?  For instance If i do the below code

if(myResult == 1 && (RunCH3.value==true) ){

            Replace_TXT("and", "TEST");

        w.close(true);   

("and", "TEST"); and Changes all instances.  and And AND ANd etc.. how can i make this case sensitive.  I would only need RUNCH 2 and 3 to be case sensitive.  I'm going to mess with this more this weekend but i have no clue where to go from here on this part.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
May 06, 2016 May 06, 2016

Also how do you get your code to display with the numbered lines on this site?

answer:

press advance editor available on right corner of your reply..select your code..apply as the below diagram

Screen Shot 2016-05-07 at 10.10.36 AM.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
May 06, 2016 May 06, 2016

for case sensitive you have to add app.findChangeTextOptions.caseSensitive = true; in your find and replace function like below

function Replace_TXT(input, output)

{

app.findChangeTextOptions.caseSensitive = true;

app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;

app.findTextPreferences.findWhat = input;

app.changeTextPreferences.changeTo = output;

app.activeDocument.changeText();

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 07, 2016 May 07, 2016

I'm glad your here i was putting that case sensitive code everywhere in this code except where you shown above thanks you again for everything your helping with.  This code is almost perfect just a few more tweeks and all will be good.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 07, 2016 May 07, 2016

My questions are on Lines 01, 06, 31, and 68.  I have asked some of these before but this is a cleaner. looking copy

// 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();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 09, 2016 May 09, 2016

I updated my above question some of the answers i got answered from other posts.  now i just basically need to know how to do the

#6 and #1.  #1 is more of a flashy thing so if its too difficult dont worry about it. thanks again.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 09, 2016 May 09, 2016
LATEST

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[0].add ("image", undefined, File ("/Volumes/PPG/z-z MISC STUFF/INDESIGN SCRIPTS/Running CHanges/mop-bucket.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"}');

*/       

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines