2016-11-22 11 views
0

내가 내 모니터 (듀얼 모드)의 실제 배경 화면 이미지를 찾아 파인더에 보여 다음 사과 스크립트를 사용하는 데 더 이상 작동하지 않습니다. 엘 캐피 탄 밑에서 스크립트는 잘 작동합니다.파인더의 실제 배경 화면을 보여주는 맥 OS-시에라 사과 스크립트를 설치 한 후

"error "„Finder“ received an error: The routine cannot work with objects of this class.“ number - 10010". The object which is highlighted in the script is "reveal rotationImage"

나는 사과 스크립트 전문가가 아니다 : 나는 맥 OS 시에라를 설치 한 후 스크립트 오류 메시지가

"error "„Finder“ hat einen Fehler erhalten: Die Routine kann Objekte dieser Klasse nicht bearbeiten." number -10010"

영어 번역을 보여줍니다. 불행히도 나는 웹상에서 어떤 도움도 찾을 수 없었다. 무엇이 문제 일 수 있습니까?

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 

답변

0

스크립트도 시에라에 내 컴퓨터에서 작동 실패 이유는 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 
+0

안녕 vadian은 스크립트가 완벽하게 작동합니다. 당신의 도움을 주셔서 대단히 감사합니다. 필자는 훌륭한 스크립트 프로그래머가 아니기 때문에이 솔루션을 결코 찾지 못했을 것입니다. 친절 감사, afrikapit – afrikapit