The problem is that you are asking for two fundamentally different things. I think you'd have to combine two scripts, perhaps though some union to get this.
Here's one: http://www.sqlservercentral.com/scripts/Maintenance+and+Management/30881/
This might be the other.: http://www.sqlservercentral.com/scripts/Database+Maintenance/94850/