Automatically hide all command

Does Mac OS X have a " hide all" :slight_smile: command or shell script that can be turned on or off at will?

Cheers,
denns

Let me be more specific concerning the above post. ASM has a "single application mode’ that automatically hides all other applications. I am looking for a command, hopefully with OS X, that will be able to turn this feature on or off at will; hopefully an applescript or unix command.

cheers,
denns

the journey is the destination

I don’t know what ASM is. What do you mean by hide all? Put all running applications in the background (out of sight)? Run in Kiosk mode? Can you say why you want to do whatever it is you want to do? It might help us to help you. :slight_smile:

To hide all running apps except the finder do this:


tell application "Finder"
	activate
	set visible of every process whose visible is true and name is not "Finder" to false
end tell

Now if you want to clean up and close al finder windows add this


tell application "Finder"
	if the (count of windows) is not 0 then
		close every window
	end if
end tell

full script


on run
tell application "Finder"
	activate
	set visible of every process whose visible is true and name is not "Finder" to false
end tell

tell application "Finder"
	if the (count of windows) is not 0 then
		close every window
	end if
end tell
end run

What I am looking for is the ability to put all running applications in the background and keep them there while I switch from app to app so that I can only ā€˜see’ the frontmost application. This is called "Single Application Mode’ in ASM (Application Switcher Menu) a small menu utility. Subsequently I want to be able to turn this abiity off without revealing the hidden apps unless I activate them by pressing thier icon in the dock. which would then layer each app on top of the previous and each apps window would now be visible.

I don’t like desktop clutter which is why I only like to view one application at a time when I have 10 running. The reason I would like to turn this autohiding feature off and on (thru an applescript) is when I want to drag a file from the desktop window to terminal to see its file path. The only way I can do this is by manually turning off 'Single Application Mode" in ASM so I can see the Terminal window and the desktop window at the same time.

I hope this helps.

cheers,
denns

You might want to try AutoHide (freeware). It provides single application mode as well as a key command that allows you to have two applications visible at the same time. The web site doesn’t mention the feature regarding two visible apps but since I’ve used AutoHide, I know about it. :wink:

Mr. Jorgenson,
Thanks for the reply. This shareware program is perfect for what I want. By holding down the shift key I can get see two application windows at the same time. Many, many thanks for bearing with my ranting and trying to explain what I want.

Cheers,
denns

Hi denns,

I’m glad that AutoHide does what you need it to do. On another note, I appreciate the respect that you’ve shown but, in the future, please feel free to address me as Rob. :slight_smile:

– Rob

Just a little script that runs the ā€œHide Othersā€ keystroke every 5 seconds (or whatever you like).

property oldForemostApp : {}

-- define frontApp and oldForemostApp
tell application "System Events"
	delay 0.2
	set frontApp to name of first application process whose frontmost is true
	set oldForemostApp to frontApp
end tell

-- repeat until script is quit
repeat
	tell application "System Events"
		-- change delay (in seconds) to whatever you like
		delay 5
		set frontApp to name of first application process whose frontmost is true
	end tell
	-- try block in case app is closed
	try
		activate application frontApp
	end try
	-- do nothing if foremost app hasn't changed
	if oldForemostApp is equal to frontApp then
		-- do nothing
	else
		tell application "System Events" to keystroke "h" using {command down, option down}
	end if
	-- store name of foremost app
	set oldForemostApp to frontApp
end repeat