"Hide All Applications" Does Not Hide Finder

I have created a simple Hide All macro using the "Hide All Applications". When I execute it, I would expect to be left just viewing my Desktop. If I happen to have a Finder window open along with the other windows, the Finder is still left standing. I have nothing in my Excluded Preferences. Thanks for your suggestions!

1 Like

Funny that I was wondering the same thing the other day.

I simply added an additional action, "Hide Front Application", since Finder was being left as the 'only' Front Application, and it works well.

Still doesn't explain why, but does what was required.

@Cassady I would think that your suggestion would work, but I get very odd behavior. When I use the hotkey once, all applications save the Finder get hidden. If I press the hotkey again, the Finder goes away, but the previous application that was open (before the first hotkey press) now appears. I'm even more baffled!

When Keyboard Maestro Hides All Applications it basically switches to the Finder and hides others.

The Finder is very odd with hiding - you don’t need Keyboard Maestro involved to determine this, just switch to the Finder and choose Finder ➤ Hide Finder. Nothing happens. With any other application, the application hides and the next application activates.

And indeed, if you go to the Finder and select Hide Others, then it dims the Hide Finder menu item.

So the whole thing is kind of weird.

Essentially if you think about it, you can't hide all applications because there has to be a front application that is not hidden. You can, apparently, Hide Others and then sort of hide the Finder, even though it doesn't want to. Which is interesting, but still weird.

1 Like

I think this is because the Desktop is part of the Finder. You can hide the items on the Desktop, but the Desktop must always show.

Finder hides for me.


System info: AppleScript version: 2.7 System version: 10.13.6

Weird. Finder ➤ Hide Finder fails to do anything for me. Mojave 10.14.5.

Yesterday, it was working and hiding Finder.
Today, not so much.
Tomorrow – who knows?

It's obviously trying to teach me something about the unpredictability of life, the universe, and everything.
And macOS [running 10.13.6]. :sunglasses:

I figured I would just chime in, and confirm that it does work over here, except when it doesn't.
So YMMV (+ MMDV).

Here is an interesting experiment:

  1. Select Finder while there are other applications visible
  2. Finder | Hide Finder menu is available. Command-H indeed hides the Finder.
  3. Open Finder again
  4. Press Command-Option-H to hide all others. Nothing but the Finder on your Desktop.
  5. Finder | Hide Finder menu is dimmed. Command-H does nothing

No clean desktop for you!

While visually unappealing, this combination seems to get the job done. It's a little odd to see most of the windows just disappear and to have the Finder window do its Genie thing to the dock. I suppose I can just look away when pressing my keystroke :nerd_face:

1 Like

What if you try ⌘W to close the only Finder window, instead of minimizing it?

The weirdness is probably based on the Finder being a special app that must be available. For example, you can quit the Finder, but it instantly restarts.

1 Like
tell application "Finder" to quit

:upside_down_face:

This is all a remnant from System 6 (7?) days; Finder is a preferred app that is presumed to be the least necessary state so that a user can act — this precedes, of course, the Dock.

By adding Quit to the Finder’s app menu, or using AppleScript, you can indeed quit Finder and it will stay quit until there is no other running app that presents a Menubar; a5 which point it will auto spawn.

As discovered, you can hide everything, including Finder, as long as at least one app remains open, even if it has no open windows. If you want your macro to work, you will have to select one “faceless”/windowless app to remain unhidden.

Edit: IOW, you have to leave the user with a functional Apple Menu, at a minimum, or macOS will force one.

1 Like

Thanks to everyone for your suggestions. I would prefer not to close or quit the Finder window, as I would like to use the last location again. Since I have tabbed viewing enabled, I typically have a number of tabs that I would like to keep open. My goal is just to visually clean house from time to time.

Except for the Genie effect on the Finder window, I have been pretty satisfied with the macro as posted.

Im pretty sure you can change the genie effect to scale in the dock system settings. And/or you can select 'reduce motion' in System Preferences -->Accessibility>>Display.

1 Like

In my experience this seems to be a bit more accurate. Let me know what you think.

tell application "Finder"
	set TotalNumberOfFinderWindows to (count of (every window where collapsed is false))
	return TotalNumberOfFinderWindows
end tell

EDIT:

Actually! The following is a bit less stupid

Sorry to have to revisit this thread.

  1. I have a macro that clears desktop icons.
  2. I have a macro that hides the menubar.
  3. I have a macro that closes all application windows. I can do it either via "Hide all apps" or with an AppleScript I write that hides all non-Finder windows. Both work.
  4. I also have a macro similar to one earlier in the thread that closes all Finder windows.

All this works. My problem is that when I switch desktops (^ ->), invariably the Music app, which had been hidden, shows. Sometimes the TV app shows. Sometimes both. Sometimes, different Macs behave differently using the same OS version, and the same KM version, and the same kmsync file. I want only the current desktop image to show on the current desktop on the current screen (different ones for different desktops of course). No icons, no Finder windows, no menu bar, no app windows.

So here is my question: who is telling an app to show itself when I told it, and the Finder, to NOT show it? And how do I prevent this from happening?

Grrr.....

So, problem solved! Who is the culprit? The Finder. Who would have guessed? The problem stemmed from the shell script to hide icons, which requires restarting the Finder. When the Finder restarts, if there are no icons on the desktop (cause you just hid them), it chooses one running application, and it makes that app visible, even if you want it hidden. The shell script to display desktop icons is:

defaults write com.apple.finder CreateDesktop true ; killall Finder

Substitute false if you want to hide them. I highly recommend you DO NOT use this shell script since it involves unspecified Finder interactions.

So, to solve my problem, I needed a way to hide the desktop icons that did not involve the Finder. I had to write some AppleScript to toggle the setting in System Settings. It's ugly. Any help cleaning it up would be greatly appreciated:

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
-- https://www.youtube.com/watch?v=MOdIFEU1WV8

tell application "System Settings"
	delay 1
	-- get properties
	reveal pane id "com.apple.Desktop-Settings.extension"
	tell pane id "com.apple.Desktop-Settings.extension"
		reveal anchor "Desktop"
	end tell
end tell

tell application "System Events"
	-- activate
	delay 0.5
	tell application process "System Settings"
		repeat while (get name of window 1) ≠ "Desktop & Dock"
			delay 0.1
		end repeat
		-- Desktop & Dock
		tell window "Desktop & Dock"
			-- discovery only
			-- get entire contents
			tell scroll area 1 of group 1 of list 2 of splitter group 1 of list 1
				tell group 4
					-- set showIcons to value of checkbox "Show Items" as boolean
					-- if showIcons then click checkbox "Show Items"
					click checkbox "Show Items"
					delay 0.5
				end tell
			end tell
		end tell
	end tell
end tell