AppleScript and Photos.app

Hello,

I am a looking to move to the next stage of automation, and looking for some assistance with AppleScript. I have the following script (based from others) but it runs with errors and I would be grateful for any assistance.

set thisLocation to alias "/Users/name/Work Photo Export"

tell application "Photos"
set theseItems to selection
if theseItems is not {} then
    export theseItems to thisLocation with using originals 
else
    display dialog "No files were selected to export!" buttons {"OK"} ¬
        default button 1 with title "Nothing To Do" with icon 1
end if
end tell

I intend to run the script via Keyboard Maestro shortcut.

Many Thanks

The errors being…?