petsas, try not to post the same question in multiple threads:
my first script any help would be appriciated.
Note that when people post code as a response to questions regarding existing scripts, that this code is usually based upon that existing script. So it is often the case that you can not simply copy/paste that shown code and use it strait away in other scripts because that code depends on other code and constants (which might not have been posted in the posts because there is nothing wrong with it).
Also, you have not the same problem as ChoPraTs. Notice how the error codes are completely different. Not to mention that you have this error comming from an entirely different script than the "Mute" script.