다음 사과 스크립트를 사용하여 모니터 (듀얼 모드)에서 실제 배경 화면 이미지를 찾아 파인더에 표시했습니다. El Capitan에서는 스크립트가 잘 작동합니다. Mac OS Sierra를 설치 한 후 스크립트에 오류 메시지가 표시됩니다.
"error" "Finder"에 오류가 수신되었습니다 : 루틴이이 클래스의 개체를 처리 할 수 없습니다. "번호 -10010"
영어 번역:
"오류" "Finder"에서 오류를 수신했습니다 : 루틴이이 클래스의 개체와 함께 작동 할 수 없습니다. "번호-10010". 스크립트에서 강조 표시된 개체는 "reveal rotationImage"입니다.
저는 애플 스크립트 전문가가 아닙니다. 불행히도 나는 웹에서 어떤 도움도 찾을 수 없었습니다. 무엇이 문제일까요?
tell application "System Events"
set posix_path to (pictures folder of desktop 1)
set picPath to (POSIX file posix_path) as string
end tell
set thePictures to (do shell script "sqlite3 ~/Library/Application\\ Support/Dock/desktoppicture.db \"SELECT data.value FROM preferences INNER JOIN data on preferences.key=16 and preferences.picture_id=5 and preferences.data_id=data.ROWID\"")
set fullPath to picPath as string
set rotationImage to fullPath & thePictures
tell application "Finder"
reveal rotationImage
activate
end tell
tell application "Finder"
get selection
repeat with moose in result
if original item of moose exists then
reveal original item of moose
end if
end repeat
end tell
스크립트는 Sierra에서도 내 컴퓨터에서 작동합니다. 실패 이유 reveal
는 리터럴 문자열이 아닌 파일 참조 를 예상하기 때문일 수 있습니다 .
이것은 약간 최적화 된 스크립트 버전입니다.
tell application "System Events"
set posix_path to (pictures folder of desktop 1)
set picPath to (POSIX file posix_path) as string
end tell
set thePictures to (do shell script "sqlite3 ~/Library/Application\\ Support/Dock/desktoppicture.db \"SELECT data.value FROM preferences INNER JOIN data on preferences.key=16 and preferences.picture_id=5 and preferences.data_id=data.ROWID\"")
set fullPath to picPath as string
set rotationImage to fullPath & thePictures
tell application "Finder"
try
set aliasItem to item rotationImage
if class of aliasItem is alias file then
reveal original item of aliasItem
end if
end try
end tell
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다