문제

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?

도움이 되었습니까?

해결책

The way to do it in pure Applescript would be:

tell application "Finder"
    set selection to {}
end

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top