Apple script for activating the "Reset Safari" menu item.

macOS and Mac Apps

I'm trying to write a script to activate the "Reset Safari" option.
The apple script editor isn't giving me any errors, so I think I have everything set up correctly, however when I run the script, safari will launch, and nothing else will happen.
I should say, that if I run the script with safari active, it works just fine.
Here is what I want the script to do.
- activate / open Safari.
- click the menu item "Reset Safari..." found in the "Safari" menu in the menu bar.
- press the okay button in the dialog.
- Quit Safari.
Can anyone help me with this?