Pregunta

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?

¿Fue útil?

Solución

The way to do it in pure Applescript would be:

tell application "Finder"
    set selection to {}
end

Otros consejos

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top