Two new pyranocoumarins were synthesized via one-pot, microwave-assisted pseudo multicomponent condensations of coumarin and 4-methylquinoline to investigate their molecular switching properties. Both are light-sensitive and have a distinct change of color upon UV irradiation. The reaction can be reverted by treating the photogenerated products with imidazoline-functionalized magnetic nanoparticles, which can be swiftly recycled with an external permanent magnet. ? 2012 American Chemical Society.