Keyboard shortcut for inverting a selection in Finder

is there a keyboard shortcut to invert a selection in finder


iMac 21.5″ 4K, macOS 13.7

Posted on Jan 28, 2026 6:41 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 28, 2026 7:05 PM

Not to my knowledge. You could always select all files (command + A) and selectively unselect some files (by clicking a file while pressing the command key.)

6 replies

Jan 29, 2026 12:31 PM in response to crb1943

Pretty easy to do with an AppleScript.


Paste the following into a Script Editor document.


use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

tell application "Finder"
	try
		-- get the front window
		set front_window to window 1
		-- get the folder it points to
		set current_folder to target of front window
		-- get a list of the currently selected item(s)
		set current_selection to (get selection as alias list)
		
		-- assume nothing to be selected
		set new_selection to {}
		-- iterate through the items in the folder
		set folder_contents to (every item of current_folder) as alias list
		repeat with i from 1 to (count folder_contents)
			--check which item we're currently looking at
			set cur_item to item i of folder_contents as alias
			-- is it current selected?
			if (cur_item) is not in current_selection then
				-- no?, so add it to the list of items to select
				set end of new_selection to cur_item
			end if
		end repeat
		-- and select the relevant items
		select new_selection
	end try
end tell


You can also incorporate this as part of an Automator Quick Action workflow (via Run AppleScript.. action).


The script is pretty bare bones, but the try/end try should catch most errors (e.g. trying to invoke the script with no Finder windows open).

Keyboard shortcut for inverting a selection in Finder

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.