applescript: determine the date of last Sunday
The following example AppleScript code works for me in macOS High Sierra and will return the date string of the previous Sunday:

set now to (current date)

if weekday of now is Monday then
    return date string of (now - 86400)
else if weekday of now is Tuesday then
    return date string of (now - 86400 * 2)
else if weekday of now is Wednesday then
    return date string of (now - 86400 * 3)
else if weekday of now is Thursday then
    return date string of (now - 86400 * 4)
else if weekday of now is Friday then
    return date string of (now - 86400 * 5)
else if weekday of now is Saturday then
    return date string of (now - 86400 * 6)
else if weekday of now is Sunday then
    return date string of (now - 86400 * 7)
end if