Using Applescript I am trying to create a iPhoto album and then import photos into that new album. This seems straightforward enough but I keep getting an error. Here is my very simple code:
tell application "Finder"
set import_folder to (folder of the front window)
end tell
tell application "iPhoto"
activate
set new_album to new album name (name of import_folder)
import from (import_folder as alias) to new_album
end tell
The album is created OK but when it tries to import songs into the new album I get the follwing error:
If I remove the album clause from the last line the photos import into the main iPhoto library (but not into an album) just fine:
import from (import_folder as alias)
If I change this to import into a named album like this it also works just fine:
import from (import_folder as alias) to album "Test Album"
Just for the heck of it I tried using the name of the album object but that also gave an error:
import from (import_folder as alias) to album (name of new_album)
What am I missing here!?!?!?
Thanks for any help,
Steve C.