A number of indoline spiropyrans were synthesized from 7,8-dihydroxy-4-methyl-2-oxo-2H-chromene-6-carbaldehyde. The products were found to exhibit both photochromic and ionochromic properties. According to the UV, IR, and 1 H NMR spectral data, they exist in the spiro form. Irradiation at λ 365 nm in 2-methylbutane-propan-2-ol (4 : 1) at 203 K induces their isomerization into colored merocyanine structure. Addition of alkaline earth and transition metal salts to acetonitrile solutions of these compounds at room temperature changes the isomer ratio and leads to formation of merocyanine complexes characterized by different colors, so that visual detection of Zn 2+ , Mg 2+ , Hg 2+ , and Pb 2+ ions is possible.