Hiding app's in X and/or 9 via script?

I was surprised to find that a search of the archives for the last year for any messages containg the word “hide” produced no results.
What I want to do is quite simple: Script the hiding of the front application.
I would like to do this in OS X, both for native X app’s and also for OS 9 app’s which are running in the Classic mode.
thanks for any help.

to hide the frontmost app


tell application "System Events"
	set visible of (every process whose visible is true and frontmost is true) to false
end tell

to hide the every app but the front most


tell application "System Events"
		set visible of (every process whose visible is true and frontmost is false) to false
	end tell

sorry forgot to mention that