자동화 용 JavaScript로 놀아 보면서 AppleScript에서 매우 단순한 작업을 수행 할 수 없습니다. (쇼커, 나는 알고있다.)자동화 용 JavaScript를 사용하여 Finder에서 모두 선택 해제
이 애플 스크립트 :
tell application "Finder" to set selection to {}
파인더의 선택을 지 웁니다.
JXA에서 동일한 작업을 수행하는 방법을 알 수 없습니다. 여기
내가 무엇을 시도했다입니다 :
var finder = Application("Finder")
finder.includeStandardAdditions = true
//this selects files in the front window...
finder.select([...array of file paths...])
//so you'd think this might work to deselect all...
finder.select([])
//...but it doesn't do anything
//then I tried each of these in turn...
finder.select(null)
//Error -10010: Handler can't handle objects of this class.
finder.selection = null
//Error -10010: Handler can't handle objects of this class.
finder.selection = []
//Script Editor crashes
//...but none were successful
어떤 제안?
(맥 OS 시에라, 스크립트 편집기 2.9)
네, 두 번째 해결책은 내가 함께 일을 끝낸 것이다. 그런 하이브리드는 가장 우아하지는 않지만 창을 닫았다가 다시 열 때보다 낫습니다. 감사! –