opacity mode to clip\stochastic

Could anybody please make a tiny script that (on selected object(s) materials) would
change the opacity mode from 'normal' to 'clip'\'stochastic'?
N.B. Only materials with transparency should be affected of course.
Many thanks in advance.