0 Replies Latest reply on Feb 26, 2012 10:39 PM by Awesh007

    INdesign Cs4 java script

    Awesh007

      hello all scripters:

       

      can any body help me to develope a script in javascript/apple script

       

      i want search a paragraph style and a character style in indesign page with page num

      i tried by this.. script.. any body give me this script in apple m not good in java script,,,,


       

       

       

      var myDc =app.activeDocument;

      var mySty = myDc.characterStyles.everyItem().name;

      var myDia = app.dialogs.add({name:"Character Style Display Menu", canCancel:true});

           with(myDia.dialogColumns.add()){    

                with(borderPanels.add()){

                     with(dialogColumns.add()){staticTexts.add({staticLabel:"Select Character Style:  "});}

                          with(dialogColumns.add())

                          {

                              var SelSty = dropdowns.add({stringList:mySty, selectedIndex:0});}

                          }

                     }

       

      var myRes = myDia.show();

      if(myRes==true)

      {

            var myChoice = mySty[SelSty.selectedIndex];

            myDia.destroy();   

            }

      else

      { exit();}

       

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

      app.findTextPreferences.appliedCharacterStyle = myChoice.toString();

      var myFind = app.findText(false).reverse();

      for(var a=myFind.length-1; a>=0; a--){

           var  myString= myFind[a];

           var myPg = myString.parentTextFrames[0].parent.name;}

       

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

       

      if(myCon==null)

                      {alert("not found");}