This is the code I'm testing in Yosemite with no luck. Note the try - end try lines are commented, so that you don't ignore any error. Should it really work? Does it work on El Capitan?
set theFolderName to "Exported albums"
set theDestinationFolder to POSIX file (POSIX path of file ((path todesktopastext) & theFolderName & ":"))
tell application "Finder"
if not (existstheDestinationFolder) then
makenewfolderatdesktopwith properties {name:theFolderName}
end if
end tell
tell application "Photos"
activate
set myAlbums to {}
repeat with thisContainer in containers
set thisContainer to contents of thisContainer
if name of thisContainer is not in {"Favorites", "Last Import", "iPhoto Events"} then
copy thisContainer to the end of myAlbums
end if
end repeat
delay 1
repeat with thisAlbum in myAlbums
log "Exporting " & name of thisAlbum
set thisAlbum to contents of thisAlbum
set thisName to name of thisAlbum
set thesePhotos to media items of thisAlbum
--try
tell application "Finder"
makenewfolderattheDestinationFolderwith properties {name:thisName}
set thisExportedAlbum to result as alias
end tell
exportthesePhotostothisExportedAlbum with using originals
--end try
end repeat
end tell
say "Done"