MEL: Query if object type exists then delete it

MEL: Query if object type exists then delete it...

Does anyone have an example of this? I am batching a series of files and want to delete all polygonal data within the files during the batch.

ls -type mesh

or,

filterExpand -sm ##

I cant remember the exact number for polys right now, but its in the helpfiles..

if (objExists bob)
delete bob;

Something like this?

to get rid of all poly mesh objects in your scene,

delete (ls -type mesh);

A even more flexibble solution would be to mace ascript that lists using a selection filter and then delete all of them. The benefits of this would be thet it could easily be converted to handle any batch deletion task you could possibly imagine.