+1 Bitter apple
A more extreme thing to do is a mouse trap. With dogs, I've never had a dog hurt in anyway by the trap, but they nudge it making it snap shut and bounce and it scares the heck out of them - no more unwanted behavior.
Not sure if a cat might get caught in it, but if a dog doesn't, I'd think a cat would be fine - and it totally works.
It's a way for a "punishment" that has nothing to do with you and 100% to do with what they are up to at the time, since you don't even have to be home for it to happen. Works well with pets if they can't attribute the negative impact to anything other than what they are doing.
So, you might try putting a mouse trap or two along the cord and inocently standing back...