Applescript - iphoto

irgendwie bin ich ganz bescheuert, aber ich schaffe iphoto nicht zu steuern, also

tell application “iPhoto” to add (contents of “Mac:Users:Viper:Pictures:Andere:IMG_2220.jpg”) to photo library album

diese ganz einfach zeile funtzt nicht ( habe auchs chon variationen probiert etc.),

pfad stimmt

Machs mal so:

tell application “iPhoto”
add “/Users/Viper/Pictures/Andere/IMG_2220.jpg” to photo library album
end tell

lg

geht leider auch nicht :frowning:

Könntest du mir mal ein paar infos mehr geben, oder ist es nur dies das Ganze script, und was willste genau tun?

lg

[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]

Hoffe es funtzt!

lg

leider funtzt es nicht :frowning: aber trotzdem thx!

Moin,
mit Automator klappt’s, auch speichern als Script-plugin oder Finder-plugin geht. Nur aufmachen mit was anderem als Automator klappt nicht :blush:

(HexEdit, Smile tun’s nicht…)

Uli

hmm ich gucks mir mal an