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
is there a keyboard shortcut to invert a selection in finder
iMac 21.5″ 4K, macOS 13.7
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.)
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.)
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).
Oh, I understand now.
And it looks like our friend @6x6 has you covered with 'Select All' and command-clicking. 👍🏽
Select items on your Mac screen - Apple Support
'Invert' a selection?
What do you mean?
select one or two files in finder then with a key combo have those deselected and all other files selected.
Thank you.
Keyboard shortcut for inverting a selection in Finder