Pseudo-randomization

I am familiar with the randomization feature for lists and events, but I would like to know how I can modify the type of randomization.

For example, if I am running four types of stimuli in one experiment, and I want the stimuli to appear in random order, but I don’t want two or more of the same type to appear one after the other. Can this be done with a macro?

Thanks!!

Unfortunately I cannot think of a way to constrain randomization in the way that you’re describing.