iPhoto - Fotoliste mit Kommentaren
Dieses Applescript erstellt eine Liste der Bild-Dateinamen inklusive ihrer Kommentare von einem auszuwählenden Album und schreibt diese in eine Textdatei namens "iPhotoList.txt" auf dem Desktop. Welche Informationen in der Textdatei landen, lässt sich leicht anpassen. Leider ist das Script nicht besonders performant.
(* iPhoto_CommentList v0.1 - hohabadu.de *)
-- :::::::::::::::::::::::::::::::::::::::: hohabadu.de ::::::::::::::::::::::::::::::::::::::::
set TextFileContent to ""
tell application "iPhoto"
set Albennamen to name of every album
set Albumname to item 1 of (choose from list Albennamen with prompt "Liste von welchem Album erstellen?" without multiple selections allowed) as text
set dasAlbum to (every album whose name is Albumname) as reference
set PhotoList to every photo of dasAlbum
repeat with thePhoto in PhotoList
set TextFileContent to TextFileContent & ((image filename of thePhoto as text) & " | " & (comment of thePhoto as text) & return)
end repeat
display dialog TextFileContent -- nur zur Veranschaulichung
my Write2File(TextFileContent)
end tell
-- write a string to file "iPhotoList.txt" at desktop
on Write2File(txt)
set destination to (open for access file ((path to "desk" as string) & "iPhotoList.txt") with write permission)
try
write txt to destination starting at eof
close access destination
on error
close access destination
end try
end Write2File
Im Scripteditor öffnen
-- :::::::::::::::::::::::::::::::::::::::: hohabadu.de ::::::::::::::::::::::::::::::::::::::::
set TextFileContent to ""
tell application "iPhoto"
set Albennamen to name of every album
set Albumname to item 1 of (choose from list Albennamen with prompt "Liste von welchem Album erstellen?" without multiple selections allowed) as text
set dasAlbum to (every album whose name is Albumname) as reference
set PhotoList to every photo of dasAlbum
repeat with thePhoto in PhotoList
set TextFileContent to TextFileContent & ((image filename of thePhoto as text) & " | " & (comment of thePhoto as text) & return)
end repeat
display dialog TextFileContent -- nur zur Veranschaulichung
my Write2File(TextFileContent)
end tell
-- write a string to file "iPhotoList.txt" at desktop
on Write2File(txt)
set destination to (open for access file ((path to "desk" as string) & "iPhotoList.txt") with write permission)
try
write txt to destination starting at eof
close access destination
on error
close access destination
end try
end Write2File
Im Scripteditor öffnen
ICQ
AIM
