Synthesis of spiropyrans as building blocks for molecular switches and dyads.