[code]on add_img(dir, alb)
tell application “Finder”
set tList to every item of dir
repeat with cItem in tList
tell application “iPhoto”
add (cItem) to album alb
display dialog cItem as string
end tell
end repeat
end tell
end add_img
(*
tell application “Finder” to set array to every folder of (“Mac:Users:Viper:Pictures:” as alias)
repeat with cItem in array
set cName to name of cItem
if cName is not “iPhoto Library” then
set makeAlb to “false”
tell application “iPhoto” to if not (album cName exists) then set makeAlb to “true”
–if makeAlb is “true” then
–tell application “iPhoto” to new album name cName
add_img((“Mac:Users:Viper:Pictures:” & cName) as alias, cName)
–end if
end if
end repeat
set array to every item of “Mac:Users:Viper:Pictures:Andere:”
tell application “iPhoto”
repeat with cItem in array
add (contents of cItem) to photo library album
end repeat
end tell*)
tell application “iPhoto” to add “Mac:Fla.jpg” to photo library album – das is nur n test^^[/code]
im großen und ganzen wars das,
zur kurzen erklärnug:
ich will alle ordner aus dem Bilder(Pictures)Ordner auslesen und die bilder, die in den einzelnen ordnern sind in das album hinzufügen
Marduck, darf ich dich entäuschen, aber die Add funktion in iPhoto funktioniert bei mir nur so, dass ich objekte aus der Photo Lybrary in ein neues Album hinzufügen kann, von aussen, wie ja du willst, geht das nicht, es ignoriert den Befehl!
müstest es mal mit dem probieren:
[quote]on add_img(dir, alb)
tell application “Finder”
set tList to every item of dir
repeat with cItem in tList
tell application “iPhoto”
add (cItem) to album alb
display dialog cItem as string
end tell
end repeat
end tell
end add_img
(*
tell application “Finder” to set array to every folder of (“Mac:Users:Viper:Pictures:” as alias)
repeat with cItem in array
set cName to name of cItem
if cName is not “iPhoto Library” then
set makeAlb to “false”
tell application “iPhoto” to if not (album cName exists) then set makeAlb to “true”
–if makeAlb is “true” then
–tell application “iPhoto” to new album name cName
add_img((“Mac:Users:Viper:Pictures:” & cName) as alias, cName)
–end if
end if
end repeat
set array to every item of “Mac:Users:Viper:Pictures:Andere:” tell application “Finder”
repeat with cItem in array
open (contents of cItem) using “iPhoto”
end repeat
end tell)
tell application “Finder” to open “Mac:Fla.jpg” using “iPhoto”* – das is nur n test^^[/quote]