Applescript to Empty all Apple Mail Trash (without confirmation prompt)

Very new to Script Editor and AppleScript, but have a short (successful) script to empty “Trash” in all Apple Mail accounts. Trash is properly emptied, however, prompt to Cancel/Erase continues to appear, requiring manual response, which I would like to eliminate, but seem (so far) unable to resolve. Any help greatly appreciated! (Hope this is properly posted!)
Jeff Anderson

Script is here (to be executed via bash):

#!/bin/bash
osascript <<EOF
tell application “Mail” to activate
tell application “System Events”
tell process “Mail”
click menu item “In All Accounts…” of menu “Erase Deleted Items” of menu item “Erase Deleted Items” of menu “Mailbox” of menu bar 1
delay 0.5 – brief wait for the confirmation sheet
if exists sheet 1 of window 1 then
click button “Erase” of sheet 1 of window 1
end if
end tell
end tell
EOF

Note that you have an invalid comment following the delay.

This works for me here on 15.7.5. Dialog appears, and immediately dismisses.

tell application "Mail" to activate
tell application "System Events"
	tell process "Mail"
		ignoring application responses
			click menu item "In All Accounts…" of menu "Erase Deleted Items" of menu item "Erase Deleted Items" of menu "Mailbox" of menu bar 1
		end ignoring
		delay 0.5 -- brief wait for the confirmation sheet
		if exists sheet 1 of window 1 then
			click button "Erase" of sheet 1 of window 1
		end if
	end tell
end tell

Awesome! That now works for me as well.
It seems my version of BBEdit perhaps “corrected” my – into an EM or EN dash. Will check on that…appreciate your noting that!
Thank you Paul so very much!!!
Jeff A