In Mojave I used this simple script to add photos to albums, based on keywords of the same name:
tell application "Photos"
activate
set albumNameList to name of albums -- lists all album names
set theSel to selection
set keywordsList to {}
repeat with thePic in theSel -- loops through selected pictures
set keywordsList to keywords of thePic -- list of keywords in selected picture
set theCount to 1
repeat with theAlbumName in albumNameList -- determines matching keyword and album, then adds
if theAlbumName is in keywordsList then
set theAlbum to item theCount in albumNameList
try
add thePic as list to album theAlbum -- note that pictures must be added as list
end try
end if
set theCount to theCount + 1
end repeat
end repeat
end tell
but in Catalina I'm having problems getting around media item ids. Does anyone have any ideas about this?
Many thanks!