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?
You can use activeDocument.guides.removeAll()
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 );