Getting the name of a selected album in iPhoto

Heya there,

I’ve been hunting around and can’t seem to find the means to get the name of a selected album in iPhoto. It seems that the best one can do is get the name of every album and then choose the album you want from this list. It seems absurd that you can get the name of every album but not of a selected one… I MUST be missing something.

When I try this code:

tell application "iPhoto"
	set currentAlbum to selection
	return name of currentAlbum
end tell

I get this error:
Can’t get name of {album id 4.294980049E+9 of application “iPhoto”}.

So, what’s up with that?

Thanks for your time!

Jacques,

I could have sworn I tried that. Thank you very much for your help. I didn’t realize that ‘selection’ was a list. That would explain the behavior I observed.

Thanks again!