I used to use a script in my macros to do that on my pally, like this:
Code:
/script UIErrorsFrame:UnregisterEvent("UI_ERROR_MESSAGE");
/use xi'ri's gift
/script UIErrorsFrame:RegisterEvent("UI_ERROR_MESSAGE");
/cast [target=mouseover] holy light
So that the error message from the trinket (xi'ri's gift) wouldn't show when it was on CD.
To be honest though, I tend to find the error sound from spells and items that are not ready more annoying and distracting, and for that I use this:
Code:
/run SetCVar("Sound_EnableSFX","0")
/cast [target=mouseover] Holy Shock
/run SetCVar("Sound_EnableSFX","1")
I think they both still work, but I've been a bit distracted as of late to notice too much to be honest.
You can also use both together, but then you run the risk of running into the character limit on particularly complex macros