파인더를위한 AppleScript는 Mavericks와 함께 작동하지 않았습니다
-
21-12-2019 - |
문제
나는이 매우 간단한 AppleScript를 가지고있다 :
tell application "Finder"
activate
set |Window| to get Finder window 1
set the current view of |Window| to icon view
set |View Options| to icon view options of |Window|
set the icon size of |View Options| to 256
set the label position of |View Options| to bottom
set the shows item info of |View Options| to true
set the shows icon preview of |View Options| to true
set the arrangement of |View Options| to arranged by name
end tell
.
는 매버릭스가 될 때까지 완벽하게 작동했습니다.좋아, 여전히 실행되지만 원하는 효과가 없습니다.아무것도 아니라, 절대적으로 아무 일도 더 이상 일어나지 않습니다.
누구나 새로운 버전의 OS X로 변경된 것을 알고 있습니까?
업데이트 1 :
이제는 Finder를 다시 시작한 후에 변경 사항이 발생합니다.따라서이 질문과 관련이있을 수 있습니다 (또는 그렇지 않을 수도 있음)« Finder Update / Refrespcript 10.8/A>에서 작동하지 않는 AppleScript - 10.8에는 문제가 없었습니다. 10.9
가 표시됩니다.해결책
이제 도움이 될 수있는 간단한 수정은 닫기 창을 추가하고 스크립트에 창을 열는 것입니다.
tell application "Finder"
activate
set |Window| to get Finder window 1
set the current view of |Window| to icon view
set |View Options| to icon view options of |Window|
set the icon size of |View Options| to 256
set the label position of |View Options| to bottom
set the shows item info of |View Options| to true
set the shows icon preview of |View Options| to true
set the arrangement of |View Options| to arranged by name
set flipTarget to folder "Users" of startup disk
set targ to target of |Window|
set target of |Window| to flipTarget
set target of |Window| to targ
(* --close |Window|
--open targ
*)
end tell
.
이상적이지는 않지만 누군가 가이 버그를 해결하는 방법을 해결할 때까지. 그리고 더 나은 설명을 원하는 버그라고 부릅니다. 그것은 할 수 있습니다.
스크립트는 창 하나의 대상을 수집합니다. 창 1을 닫습니다. 그런 다음 창 1의 목표를 엽니 다.
나는이 버그가 응용 프로그램 환경 설정 플라이리스트 파일을 열고 변경을하는 경우,이 버그가 Mavericks에있는 사실과 관련이 있다고 생각합니다. 변경 사항은 10.9 프리에서 수행하는 것처럼 적용되지 않을 수 있습니다. 나는 이것이 환경 설정을 읽는 방식과 읽을 때의 변화 때문이라고 생각합니다. 나는 메모리에있는 것이 수동 변화에 대해 대통령을 취하는 것으로 보입니다. 그러나 UNIX 명령 기본값을 사용하면 곧바로 변경됩니다.
*** 업데이트 * 1
마틴의 답변에서는 목표물을 뒤집는 것이 좋습니다. 그러나 루트 디렉토리에서 작동하지 않는 문제가 있습니다.
특정 플립 대상을 사용하는 것입니다. 이 CAE에서 사용자 홈 폴더. 우리 모두는 그 중에 있습니다 ..
코드의 마지막 부분을 업데이트하고 이전 비트를 주석 처리했습니다.
변경 코드는
입니다.set flipTarget to folder "Users" of startup disk
set targ to target of |Window|
set target of |Window| to flipTarget
set target of |Window| to targ
. 다른 팁
@markhunte는 맞습니다 - 버그 인 것처럼 보이는 것 같고 창을 다시 열거 나 주위를 돌리고 비슷한 것 같습니다. macscripter.net 추가 정보를 찾았습니다.내 현재 버전은 현재 (다른 새로운 트릭을 배웠습니다) :
tell application "Finder"
activate
tell Finder window 1
set current view to icon view
set its icon view options's properties to {icon size:64, label position:bottom, shows item info:true, shows icon preview:true, arrangement:arranged by name}
-- we refresh the window to reflect the icon size change!
set Original_Target to its target as alias
set Parent_Target to container of its target as alias
set target to Parent_Target
set target to Original_Target
end tell
end tell
.
이 솔루션은 창을 닫을 필요가 없지만 대상을 변경합니다.스크립트 편집기에서는 창 깜박이는 표시되지만 스크립트 메뉴에서 시작하면 빠르게 표시되지 않습니다.
@markhunte 솔루션을 통해이 솔루션의 단점 : 루트 디렉토리에서 작동하지 않습니다.