applescript: determine the date of last Sunday I need to take today's date and work backwards to Sunday and get that date.  so, for instance today is Monday, December 16.  I need to know that the previous Sunday was December 15.

I've tried several different approaches

set theDate to ((current date) - 1)
repeat until (weekday of theDate) = Sunday
    set theDate to theDate - 1 * days
end repeat


but have not had any luck.
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