The spectator does virtually everything.
The magician gives the stack of envelopes, a card, and a writing utensil to the participant. The magician could leave the room at this point because the participant writes down their information, places it in the envelope, seals it, and sticks it in their pocket before the magician touches anything.
They hand the extra envelopes to the magician and the magician can reveal the information.