質問

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