Reply To: Delete All Content on All Pages?

Home Page / Forums / General InDesign Topics (CLOSED) / Delete All Content on All Pages? / Reply To: Delete All Content on All Pages?

#77604

Without removing any layer or creating any layer, the following ExtendScript (JavaScript) should do what you want:

[code]

app.doScript
(

removeAllPageItems,
ScriptLanguage.JAVASCRIPT,
[],
UndoModes.ENTIRE_SCRIPT,
"Remove All PageItems | SCRIPT"

);

function removeAllPageItems(){

//ExtendScript (JavaScript):
var myDoc = app.documents[0];

//Unlock all layers in case some or all layers are locked:
myDoc.layers.everyItem().locked = false;

//Unlock all page items in case some or all page items are locked:
myDoc.pageItems.everyItem().locked = false;

//Remove all page items in one go:
myDoc.pageItems.everyItem().remove();

};
[/code]

Hope, that the code formatting in the forum’s editor is working as expected ;-)

Uwe

This article was last modified on August 27, 2015

Comments (0)

Loading comments...