This is a totally ineffective response but it will get any parrot's attention immediately. The bird will probably stop dumbfounded in mid-yell with its beak wide open looking at you as if you had lost your mind. This is one of the greatest drama rewards possible and parrots learn quickly to scream, yell, bite or anything else to get your to scream at them.
Most parrots thrive on drama and love it when their owners get excited.
This usually stops the bird from doing what it was doing at the moment but provides only a temporary distraction. If it is done with aggression, squirting a bird can create serious problems in the parrot-human bond. It's also a quick way to make birds hate their showers or baths. It is really important for their feather condition and health for our birds to be misted, showered or bathed. Using a spray bottle or squirt gun to punish them may make this necessary part of grooming more difficult.