skip to Main Content

I can only find out a way to remove a single guide from the layout:

activeDocument.guides[0].remove();

This targets a single guide using an index. Isn’t there a menu I can call to clear all guides at once?

2

Answers


  1. Traditionally, you had to remove the guides in reverse order:

    // function CLEAR ALL GUIDES ()
    // ----------------------------------------------------------------
    function clear_all_guides()
    {
      var numGuides = activeDocument.guides.length;
      if (numGuides == 0) return;
    
      // Delete 'em in reverse order 
      for (var i = numGuides -1; i >=0; i--)
      {
        app.activeDocument.guides[i].remove();
      }
    }
    

    which is the same as

     var idclearAllGuides = stringIDToTypeID( "clearAllGuides" );
     executeAction( idclearAllGuides, undefined, DialogModes.NO );
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search