0 Replies Latest reply on Sep 10, 2014 12:39 AM by Pandemonico

    help alternating find and changebylist.jsx script that comes with CC samples

    Pandemonico

      i did alternate the same vbs script to suit my needs and i was happy about it (likeChild when you give him his favourite toy) but i run in som problems with it....when i copy and place the vbs script on other computer i want it to use it invokes CS6 instead of CC...i tried everything i could think of but no luck...same thing happens every time i try to use it open CS6 instead CC in which i run it...on the computer i did write it the script run like charm(on both computers i have CS6 and CC)....so i decided to use the jsx version of same script....

       

      then when i try that script:

      1. the dialog box is opening only when my cursor is in textframe allowing me to select what i want to change 1.document 2.selected story. 3 selection

      2. when i select 2 text frames and on document i have 3 or more the script does not change in 2 selected frames instead it does in all frames

       

      i need to alternate this script

      when i select text frame to open dialogbox allowing me to pick 2 of 3 above mentioned options the number 2 and 3

      so it do the find and change only in text frames i selected (when it is selected with selection tool) not in all frames

       

      i tried to do that my self but im kinda short of knowledge

       

      i tried to alternate the case dialog box is open adding the line case "TextFrame": in this portion of script

      if(app.documents.length > 0){

              if(app.selection.length > 0){

                  switch(app.selection[0].constructor.name){

                      case "InsertionPoint":

                      case "Character":

                      case "Word":

                      case "TextStyleRange":

                      case "Line":

                      case "Paragraph":

                      case "TextColumn":

                      case "Text":

                      case "Cell":

                      case "Column":

                      case "Row":

                      case "Table":

                          myDisplayDialog();

       

      and it work for invoking the dialog box when the text frame is selected but then it only do changes in first textframe selected not in all selected....

       

      so i tried to experiment with this line

      if(myResult == true){

              switch(myRangeButtons.selectedButton){

                  case 0:

                      myObject = app.documents.item(0);

                      break;

                  case 1:

                      myObject = app.selection[0].parentStory;

                      break;

                  case 2:

                      myObject = app.selection[0];

                      break;

              }

              myDialog.destroy();

              myFindChangeByList(myObject);

          }

          else{

              myDialog.destroy();

          }

      by changing the number to 1 or 2 or 3 but that only told the script that if i have 2 text frame selected to do search in second text frame (incase of number 1) or if i have 3 selected and in case of numer 2 only do script in 3 text frame

       

      i need help please