0 Replies Latest reply on Nov 20, 2014 11:59 PM by hamdifem

    For multiple selection this script edit help

    hamdifem Level 1

      2 or 3 selection text frame this script run?

      selection = app.activeDocument.selection;
      for (var j = 0; j<selection.length; ++j);
      var doc = app.properties.activeDocument,  
          myOnjectStyle = doc.objectStyles.itemByName = "myObj1",  
          myObjects, l;
      app.findTextPreferences = app.changeTextPreferences = null;  
      app.findTextPreferences.findWhat = "^a";  
      myObjects = (app.selection && app.selection[j]).findText () || doc.findText ();  
      l = myObjects.length;  
      while(l--) myObjects[l].pageItems[0].appliedObjectStyle = myOnjectStyle;
      n = app.selection[j].textFrames.length;    
      while (n >= 0)    
      {    
           try {    
                var islem = app.selection[j].textFrames[n];
                islem.appliedObjectStyle = "myObj2";
           } catch(_) {}    
           n--;    
      }