2014-01-11 4 views
0

Safari에서 원격으로 읽기 목록에 추가하는 다운로드 링크를 자동으로 열고 싶습니다. iOS의 읽기 목록에 쉽게 추가 할 수 있으며 변경 사항은 컴퓨터에서 즉시 확인할 수 있습니다.독서 목록에 추가 된 웹 페이지를 열어서 AppleScript로 작성하려고 시도했습니다.

내 생각에 추가 된 새 파일을보고 폴더 작업 AppleScript를 사용하는 것입니다/라이브러리/사파리/ReadingListArchives/

새로운 숫자 폴더 "Page.webarchive"파일과 ReaderPage "가능하면이 포함이 추가됩니다. webarchive "

내 스크립트는 기존 폴더 작업 인"새 항목 추가 경고 "를 기반으로합니다.
이것이 코드를 작성한 첫 번째 시도라는 점을 유의하십시오. 여기에 있습니다 :

on adding folder items to this_folder after receiving added_items 
try 
    tell application "Finder" 
     --get the name of the folder 
     set the folder_name to the name of this_folder 
    end tell 

    tell application "Finder" 
     --go to the desktop 
     activate 
     --open the folder 
     open this_folder 
     --select the items 
     reveal the added_items 
     --select the items 
     tell application "System Events" 
      set item_list to POSIX path of file "Page.webarchive" of added_items 
     end tell 
    end tell 

    tell application "Safari" to open POSIX file item_list 
end try 
end adding folder items to 

이 코드는 webarchive가 포함 된 새로운 영숫자 폴더를 성공적으로 엽니 다. 계속해서 Safari에서 페이지를 열 것인지 묻는 메시지를 작성하려고했습니다. 내 이해 파일을 열려면 POSIX 경로가 필요합니다. 나는 그 경로에 이름을 짓고 Safari에 직접 연결하려했습니다. 이것은 아마도 경험이 없으므로 분명히 알 수 있습니다. 조언을 가진 사람 덕분입니다.

나는 Safari 사이드 패널에 나타나기는하지만 직접 다운로드 링크가 여기에 나타나지 않는다는 사실을 알고 있으며, 그 위치가 궁금합니다. 이 코드는 해당 링크를보고 열 때 유용 할 것입니다.

직접 파일 링크처럼 웹 목록으로 저장할 수없는 읽기 목록 추가를 볼 위치가 있습니까? 그리고 내 코드에 따라, 어떻게하면 Safari가 AppleScript로 초점을 맞춘 새로운 파일을 열도록 명령 할 수 있습니까?

정말 고마워요, 케니

답변

0

이 시도 :

on adding folder items to this_folder after receiving added_items 
    repeat with aFolder in added_items 
     set archivePath to (aFolder as text) & "Page.webarchive" 
     try 
      tell application "Safari" to open archivePath 
     end try 
    end repeat 
end adding folder items to