Peel and cut 4 apples into pieces and make a compote by putting them in a saucepan with a little water (1 or 2 glasses). Stir well. When the apples start to soften, add the packet of vanilla sugar. Add a splash more water if necessary.
While the compote is cooking, peel and quarter the last two apples, then cut the quarters into thin strips (they will be placed on top of the compote).
Preheat the oven to 210°C (410°F, Gas 7).
Let the compote cool a little and roll out the shortcrust pastry and place in a flan dish. Prick the base in several places with a fork.
Pour the compote over the dough and place the apple slices in a spiral or several circles, as desired. Fleck the top with slices of butter.
Place in the oven and bake for 30 minutes max, keeping an eye on it so it doesn't catch.
Add a little vanilla sugar on top of the pie during baking to caramelise, or add a little apple jelly once baked to make it shiny. Serve with caramel sauce or dulche de leche (optional).