0 Replies Latest reply on Feb 23, 2016 11:03 PM by karthickm50893796

    How to change symbols without selecting

    karthickm50893796 Level 1

      Screen Shot 2016-02-24 at 12.28.45 pm.png

      var docRef=app.activeDocument;

      var symbolNum=prompt("Enter the number of the Symbol you want to replace each selected object",1);

      for(i=0;i<docRef.selection.length;i++){

          var currObj=docRef.selection[i];

          var currLeft=currObj.left;

          var currTop=currObj.top;

          var currWidth=currObj.width;

          var currHeight=currObj.height;

          var currInstance=docRef.symbolItems.add(docRef.symbols[symbolNum-1]);

          currInstance.width*=currHeight/currInstance.height;

          currInstance.height=currHeight;

          currInstance.left=currLeft;

          currInstance.top=currTop;

          currInstance.selected=true;

          currObj.remove();

          redraw();

      }