This question concerns this sentence in the time stop spell's description:
This spell ends if one of the actions you use during this period, or any effects that you create during this period, affects a creature other than you or an object being worn or carried by someone other than you.
When exactly does the spell end? Before the action or effect affects the creature, or after it affects the creature?
Here is the specific situation I am thinking about:
Alice is attempting to steal an object off of Bob's person. Alice casts time stop and begins to go through Bob's pockets to find the object. Can Alice use her action to search Bob, find/take the object, and use her movement to run away before the spell ends?
Would this be a valid ruling, according to the language of the spell?
If not, what is the correct way to resolve this?