2011-08-31 16 views
1

我有一系列光盤映像是由我的數碼相機中的存儲卡製作而成的。所以,基本上,DCIM文件夾中的一堆照片和視頻。Applescript裝載光盤映像並將照片導入到iphoto圖庫

在我看來,應該有一種方法來讓蘋果裝載這些光盤映像,並將所有這些照片添加到我的iphoto圖書館,通過事件分隔天。我也希望它導入JUST照片 - 跳過所有視頻。

任何機構都知道魔法代碼?

回答

-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 
相關問題