Question

How can I clear the selection of a Finder item. I just updated to Mavericks from Snow Leopard and in Snow Leopard if you pressed esc, it would clear the current selection. Like this:

tell application "System Events" to key code 53

How is this done in Mavericks?

Was it helpful?

Solution

The way to do it in pure Applescript would be:

tell application "Finder"
    set selection to {}
end

OTHER TIPS

Ah, found it.

Hold Option and select "Deselect All" from Finder's "Edit" menu. Alternatively just use the shortcut Option+Cmd+A.

So as AppleScript:

tell application "System Events" to keystroke "a" using {command down, option down}

source: http://www.codez4mac.com/forum/viewtopic.php?f=212&t=72255

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top