2011-08-31 4 views
1

디지털 카메라의 메모리 카드로 만든 일련의 디스크 이미지가 있습니다. 기본적으로 DCIM 폴더에 사진과 비디오가 많이 있습니다.AppleScript로 디스크 이미지를 마운트하고 사진을 iphoto 라이브러리에 가져옵니다.

애플 스크립트가 이러한 디스크 이미지를 마운트하고 모든 사진을 내 iphoto 라이브러리에 추가하여 이벤트로 구분하는 방법이 있어야합니다. 또한 모든 동영상을 건너 뛰고 그냥 사진을 가져 오길 원합니다.

모든 신체는 마술 코드를 알고 있습니까?

답변

-1

도움이 될 것입니다. 방금 인터넷에서 꺼내서 함께 연결했습니다. 작동하는지 알려주세요. :)

tell application "Finder" 
    if not (exists "disk_image_name") 
    do shell script hdiutil mount "disk_image_name".dmg 
    end if 
end tell 
tell application "iPhoto" 
     import from "disk_image_name" 
     delay 5 -- wait for import to finish 
     tell (the first album whose name is "albumtoimportto") to select photos 
     assign keyword string "autoimport" 
     select (the first album whose name is "autoimport") 
     close application "iPhoto" 
    end tell