Disable system sound output for a script?

I didn’t remember seeing that code. I know I found it when I searched for it (before posting). I didn’t believe this was the solution. That said I just tried it and it’s fast, doesn’t beep and seems to work, though I have yet to see whether this also works in the context of my bigger script. I’ll try and let you know whether this works. Thanks for help, Nigel.