A random selection of stimuli from list

Hi all,

I’m very new to SLab, so apologies if this question has an obvious answer.

I have lots of images (1000+) that need to be rated, and am planning to show each participant a random selection of about 20. I know how to call up a list of images in an event, but how would I go about getting SLab to call up only 20 of them and not the full list of 1000?


Hello Rob,

Assuming you have already created a Block, Trial, and Event, here are some detailed instructions on how to randomize a limited number of your events.

  • Double click on the Blocks, to bring up the Block Editor
  • Click on the Macros tab, then click the New button to create a new Macro
  • Give the Macro a name, and click on the Expression tab to create the new Expression. This will bring up the Expression Editor window
  • In the top right field select “Trials Presented in This Block”
  • Three option appear in the top left field. Select “Number of”
  • Ignore the Subset field, but notice the drop down menu below it
  • Select “Is Equal To”
  • Enter 20 for the Value

This is how you tell SuperLab to only present 20 trials within a block. Now we need to tell SuperLab what to do after the 20 trials have been presented. We do this under the “If True” tab.

  • Click on the New button to bring the New Action window
  • In the Do the Following drop down menu, select “Go to Another Block”
  • In the second section make sure you have marked “Continue with the next block”, click OK
  • Click OK again to exit the New Macro window
  • You will now see the Macro listed, check the box next to your Macro
  • Tell SuperLab to Run this Macro “After each trial is presented”, click OK

I hope this information is helpful to you.

Thanks Monica,

Big help


Monika, This bit of text was a big help to me, too! Thanks.

But suppose I wanted to repeat this three or four times. That is, they get 20 out of the 1000 stimuli, but then I want to give them 20 more out of the 1000, and 20 more, and so on. Is there a way to do that without making three or four blocks?

For some applications it would be crucial that the 2nd 20 and 3rd 20 and so on not include any stimuli previously seen, although for my current application that would not matter.


What do you want in-between the 20 stimuli? Do you want your participants to have a break, or do you want some other event type?

For what I’m envisioning right now, I’d like nothing in between (no break, no other events).

I think I’m a little confused. Couldn’t you just follow the same directions as posted above to accomplish this?

Yes, I could. I was just asking if there’s a way to do this without copying in a new block for each time I want to repeat it. It seemed sort of silly to me to have so many identical blocks pasted in one after the other, but I see now that it does work.