3 Replies Latest reply on Sep 1, 2016 9:01 AM by Obi-wan Kenobi

    Find an object with an object style and increase his height! …

    Obi-wan Kenobi Adobe Community Professional

      Hi all,

       

      I would like to found each "invisible" (anchored in current text) block with a specific object style 'AA' and modify its height IF its Y-Offset is > 180 (by reference to the 0,0 page origin by default).

      That seems to be simple but, one again, that doesn't work! 

       

      Thanks in advance!

       

      (^/)

       

       

      app.doScript("main()", ScriptLanguage.javascript, undefined, UndoModes.FAST_ENTIRE_SCRIPT, "xxx");
        
      function main()
      {  
        
      app.findObjectPreferences = null; 
      app.findObjectPreferences.appliedObjectStyles = "AA"; 
      myFound = app.activeDocument.findObject();
      
      
      for (i = 0; i < myFound.length; i++)  
           {  
              var myGB = myFound.geometricBounds;
              var myYOffset = myGB[2]; 
              var myHeight = myGB[2] - myGB[0]; 
              
              if (myYOffset[i] > 180) myHeight[i] += 90; 
           }  
      
      }