The key you're looking for is Cmd.
Select the files – any view should work – then move with the mouse cursor to the empty space next to the file list. Hold Cmd and drag to invert the selection:
![](../../I/static/images/6226e7fd01cea65e8785d88c044ea03e022734b0c1c72b41768c6dc977d9bc9e.png)
If you don't want to use the mouse, an alternative way would be to use AppleScript instead. Open up Automator.app, create a new Service. From the left pane, drag Run AppleScript to the right, and paste the following:*
on run {input, parameters}
tell application "Finder"
set inverted to {}
set fitems to items of window 1 as alias list
set selectedItems to the selection as alias list
repeat with i in fitems
if i is not in selectedItems then
set end of inverted to i
end if
end repeat
select inverted
end tell
return input
end run
Set this service to receive No Input from Finder.app. Like this:
![](../../I/static/images/a434b7253e1dbe8e2e3131b9af9e7aeb6c7cf94b00f44058da552052e8451ab9.png)
Save this service as Invert Selection. Then, head to System Preferences » Keyboard » Keyboard Shortcuts, and add your shortcut to the service, for example ShiftCmdI:
![](../../I/static/images/238e938ff832feb09a9d584074eff19a568ddc531ef37b188a0973aaf068830d.png)
Now, select any files in Finder and press the shortcut to invert the selection.
* I found this on the Apple Mailing Lists, no idea who wrote it though.
1The
cmd
trick is awesome. – entropid – 2014-11-18T00:26:48.170I have tried this solution on Yosemite 10.10. The script is working but can't use this keyboard shortcut as it conflicts with the built-in iCloud keyboard shortcut. I have tried many other keyboard shortcut but couldn't run the script as a service. – politicus – 2017-09-05T11:07:00.137
You have to write a script and do all this crap on a mac to do something as mundane as inverting a selection? Which is really common because you could have a folder of 5000 pictures, and you perhaps just want to keep 5 of them? – Muhammad bin Yusrat – 2020-02-15T11:55:26.033
If the script is run after opening a new window, it usually selects all files because of this bug.
– Lri – 2012-11-02T11:19:09.583Your script does not scale all to well. Works fine for a folder with <50 items, but for a folder with 1500 items it resulted in a timeout :-( My use case: I made aliases to desired files within a folder of 1500 files. I select all aliases, press CMD-R (reveal originals), and then would like to invert the selection, to then erase the needless files. Workaround: Move the selection into a temporary folder, delete the remaining undesired files, move the desired files back. – porg – 2014-02-25T20:37:16.877
@porg Well, who has 1500 items in a folder! :) But yeah, AppleScripts don't scale that well, you're right. – slhck – 2014-02-25T20:46:37.040
Would there be a possibility to save the items as a something less resource intensive than an alias list, i.e. a POSIX file list or the like? – porg – 2014-02-26T08:41:48.987