**3. Experimental Section**

#### *3.1. General Information*

Unless otherwise stated, all reagents were purchased from commercial suppliers and used without purification. *t*-Boc-protected 6-6 -dibromoindigo (**11**) [38] and stannanes **12c [46]**, **12d** and **12e [44]** were prepared as previously reported. All air-sensitive reactions were performed using Schlenk techniques. Solvents used in cross-coupling reactions were previously degassed by means of the "freeze-pump-thaw" method. Tetrahydrofuran (THF) was freshly distilled immediately prior to use from sodium/benzophenone. CH2Cl2, toluene, and acetonitrile were dried on a resin exchange Solvent Purification System. Petroleum ether, unless specified, is the 40–70 ◦C boiling fraction. Organic phases derived from aqueous work-up were dried over Na2SO4. Reactions were monitored by TLC on SiO2 plates, the detection was made using a KMnO4 basic solution or UV lamp**.** Flash column chromatography was performed using glass columns (10–50 mm wide) and SiO2 (230–400 mesh). 1H-NMR spectra were recorded at 200, 300, or 400 MHz and 13C-NMR spectra at 50.0, 75.5, or 100.6 MHz, respectively. Chemical shifts were referenced to the residual solvent peak (CDCl3, δ 7.26 ppm for

1H-NMR and δ 77.16 ppm for 13C-NMR; THF-*d*<sup>8</sup> δ 3.58 and 1.72 ppm for 1H-NMR, δ 67.21 and 25.31 ppm for 13C-NMR; CD2Cl2, δ 5.32 ppm for 1H-NMR, δ 53.84 ppm for 13C-NMR). Coupling constants (*J*) are reported in Hz. ESI-MS were recorded with LCQ-Fleet Ion-Trap Mass Spectrometer. HR-MS were performed using an LTQ Orbitrap FT-MS Spectrometer. FT-IR spectra were recorded with a Perkin-Elmer Spectrum BX instrument in the range 4000–400 cm−<sup>1</sup> with a 2 cm−<sup>1</sup> resolution. UV-Vis spectra were recorded with a Varian Cary 400 spectrometer and a Shimadzu 2600 series spectrometer, and fluorescence spectra were recorded with a Varian Eclipse instrument, irradiating the sample at the wavelength corresponding to maximum absorption in the UV spectrum. UV-Vis spectra in different solvents were recorded on diluted solutions of the analyte (approximately 10−<sup>5</sup> M) with a Shimadzu UV2600 spectrometer. UV-vis absorption or transmittance spectra of the compounds adsorbed on TiO2 were recorded in transmission mode after the sensitization of thin, transparent semiconductor films (thickness approximately 5 μm).

Cyclic voltammetry experiments were conducted in chloroform solutions with a PARSTAT 2273 electrochemical workstation (Princeton Applied Research) employing a three-electrode cell having a 3 mm glassy carbon working electrode, a platinum counter electrode and an aqueous Ag/AgCl (sat. KCl) reference electrode and using ferrocene as a standard. The supporting electrolyte was electrochemical-grade 0.1 M [*N*(Bu)4]PF6; the dye concentration was approximately 10−<sup>3</sup> M. Under these experimental conditions, the one-electron oxidation of ferrocene occurs at E0 = 0.55 V.

#### *3.2. Computational Details*

Molecular and electronic properties of keto–keto (KK), keto–enol (KE) and enol-enol (EE) tautomers of compounds **5a**, **5b**, **5c**, **5d**, **6d** and **DF90** have been computed via DFT [54–56] and time-dependent DFT (TD-DFT) [57,58] methods, using the Gaussian 16, Revision B.01 suite of programs [59]. Geometry optimizations have been carried out *in vacuo* and in solvent (DCM) using the polarizable continuum model (PCM) [60] to take into account solvent effects, at the B3LYP/6-31G\*\* level of theory [61,62], according to a previous work of Amat et al. [9]. For molecule **5b**, methyl groups have been used in place of the alkyl chains attached to the ProDOT moiety in order to reduce the computational cost. Frequency calculations on the optimized structures have been performed at the same level to check that the stationary points were true energy minima. The ground-state electron density delocalization and the energy of DFT frontier molecular orbitals have been calculated at the same level of theory in DCM. The UV-Vis spectroscopic properties of the analyzed compounds, including absorption maximum (λ<sup>a</sup> max), vertical excitation energy (Eexc) and oscillator strengths (*f*) have been calculated in DCM on the minimized structures by means of TD-DFT at the B3LYP/6-311++G\*\* and CAM-B3LYP/6-311++G\*\* levels of theory [63].

#### *3.3. Synthesis*

## 3.3.1. Synthesis of Tributyl(3,3-dipentyl-3,4-dihydro-2H-thieno[3,4-b][1,4]dioxepin-6-yl)-stannane (**12b**)

3,3-Dipentyl-3,4-dihydro-2*H*-thieno[3,4-b][1,4]dioxepine (ProDOT, 1.35 g, 4.56 mmol, 1.0 eq.) was dissolved in dry THF (14 mL). The solution was cooled to −78 ◦C, and *n*-BuLi (1.6 M solution in hexanes, 3.2 mL, 5.5 mmol, 1.2 eq.) was slowly added. The reaction mixture was allowed to warm up to −20 ◦C while stirring, then cooled down again to −78 ◦C. Tributyltin chloride (Bu3SnCl, 1.78 g, 5.5 mmol, 1.2 eq.) was added and the solution was allowed to warm up to room temperature and left under stirring overnight. The mixture was diluted with Et2O (20 mL) and washed with a cold saturated solution of NH4Cl (2 × 30 mL). The solvent was removed under reduced pressure to yield crude product **12b** (1.74 g, 3.0 mmol, 66% yield), which was used without further purification. 1H-NMR (200 MHz, CDCl3) δH = δH = 6.67 (1H, s), 3.75–3.87 (10H, m), 1.19–1.74 (24H, m), 0.76–1.03 (15H, m) ppm; 13C-NMR {1H} (50 MHz, CDCl3) δC = 155.7, 114.8, 111.0, 77.6, 43.8, 43.7, 32.7, 32.2, 29.0, 27.9, 27.2, 22.5, 14.0, 13.7, 10.7 ppm.

## 3.3.2. General Procedure for Preparation of Compounds **6a**–**d**

Pd2(dba)3 (10 mg, 0.011 mmol, 0.05 eq.) and P(o-Tol)3 (7 mg, 0.022 mmol, 0.1 eq.) were dissolved in toluene (4 mL) and the solution was left at room temperature, under stirring for 15 min. *t*-Boc-protected 6-6 dibromoindigo (**11**, 93 mg, 0.22 mmol, 1.0 eq.) was then added and the mixture stirred at room temperature for additional 15 min. The required stannane (0.46 mmol, 2.1 eq.) was dissolved in dry toluene (4 mL), and added to the reaction mixture, that was then warmed up to 50 ◦C, left under stirring and monitored by TLC. After 5 h, the mixture was cooled to room temperature, the solvent was removed by rotatory evaporation, and the crude was purified by flash column chromatography.

*(E)-(1,1 -di-tert-butyl 3,3 -dioxo-6,6 -bis(thiophen-2-yl)-1H,1 H,3H,3 H-[2,2 -biindolylidene-1,1 -dicarboxylate)* (**6a**). Compound **11** (92.5 mg, 0.22 mmol, 1.0 eq.) was reacted with tributyl(thiophen-2-yl)stannane **12a** (173 mg, 0.46 mmol, 2.1 eq.). Purification (petroleum ether:EtOAc gradient from 50:1 to 10:1) gave **6a** (119 mg, 0.19 mmol) as a purple red solid. Yield 86 %. Spectroscopic data were in agreement with those already reported.[45] 1H-NMR (400 MHz, CDCl3) δH = 8.32 (2H, s), 7.77 (2H, d, *J* = 7.9 Hz), 7.52 (2H, d, *J* = 3.5 Hz), 7.48 (2H, dd, *J*<sup>1</sup> = 7.9Hz, *J*<sup>2</sup> = 0.8Hz), 7.43 (2H, d, *J* = 5.0 Hz), 7.17–7.13 (m, 2H), 1.69 (18H, s). 13C-NMR{1H} (100 MHz, CDCl3) δC = 182.8, 150.0, 149.7, 143.6, 141.8, 128.7, 127.2, 125.6, 124.8, 122.0, 121,8, 114.0, 113.6, 84.8, 28.4. FT-IR (neat): ν = 3006 (w), 2956 (m), 2924 (m), 2854 (m), 1743 (s), 1670 (s), 1603 (s), 1579 (m) cm<sup>−</sup>1. MS (ESI) *m*/*z* 627.1 [M + 1]+.

*(E)-(1,1 -di-tert-butyl 6,6 -bis({3,3-dipentyl-2H,3H,4H-thieno[3,4-b][1,4]dioxepin-6-yl})-3,3 - dioxo-1H, 1 H,3H,3 H-[2,2 -biindolylidene]-1,1 -dicarboxylate)* (**6b**). Compound **11** (92.5 mg, 0.22 mmol, 1.0 eq.) was reacted with stannane **12b** (271 mg, 0.46 mmol, 2.1 eq.). Purification (CH2Cl2: petroleum ether = 50:1) gave **6b** (155 mg, 0.15 mmol) as a purple red solid. Yield 67%. 8.29 (2 H, br. s), 7.72 (2H, d, J = 8.2 Hz)), 7.61 (2 H, d, J = 8.2 Hz), 6.53 (2H, s), 4.02 (4H, s), 3.93 (4H, s), 1.67 (18H, s), 1.46–1.39 (8H, m), 1.38–1.25 (26H, m), 0. 91(12H, t, J = 6.9 Hz) ppm. 13C-NMR{1H} (100 MHz, CDCl3) δC =182.4, 150.5, 149.3, 147.9, 141.0, 129.0, 128.4, 125.4, 125.0, 121.1, 113.8, 104.9, 84.3, 77.7(2C), 43.7, 32.6, 32.0, 28.2, 28.0, 22.5, 14.0. FT-IR (neat): ν = 2926 (w), 2857 (w), 1605 (s), 1439 (s), 1374 (w) cm<sup>−</sup>1. HRMS (ESI) m/z calculated for C60H79N2O10S2: 1051.5170. Found: 1051.5177 [M + 1]+.

*(E)-(1,1 -di-tert-butyl 6,6 -bis(4-{bis[4-(hexyloxy)phenyl]amino}phenyl)-3,3 -dioxo-1H,1 H, 3H,3 H-[2,2 biindolylidene]-1,1 -dicarboxylate)* (**6c**). Compound **11** (130 mg, 0.2 mmol, 1.0 eq.) was reacted with stannane **12c** (308 mg, 0.42 mmol, 2.1 eq). Purification (petroleum ether: EtOAc gradient from 50:1 to 10:1) gave **6c** (210 mg, 0.16 mmol) as a purple solid. Yield 78 %. 1H-NMR (200 MHz, CDCl3) δH = 8.29 (2H, s), 7.62–7.91 (6H, m), 7.53 (4H, d, J = 8.8 Hz), 7.36–7.47 (6H, m), 7.13 (8H, d, J = 8.8 Hz), 7.00 (4H, d, J = 8.8 Hz), 6.88 (8H, d, J = 8.8 Hz), 3.96 (8H, t, J = 6.4 Hz), 1.72–1.79 (8H, m), 1.65 (18H, s), 1.56–1.30 (24H, s), 0.88–0.97 (12H, m) ppm. 13C-NMR{1H} (50 MHz, CDCl3) δC 182.9, 156.0, 149.9, 149.6, 148.7 143.4, 140.1, 131.1, 130.5, 129.0, 128.4, 128.1, 127.2, 125.5, 124.4, 119.7, 115.5, 84.2, 68.4, 31.7, 29.4, 28.2, 25.8, 22.6, 14.1. FT-IR (neat): ν = 2940 (m), 2929 (m), 2856 (m), 1733 (m), 1673 (s), 1589 (s), 1507 (s) cm<sup>−</sup>1. HRMS (ESI) m/z calculated for C86H100N4O10: 1348.7434. Found: 1348.7455 [M]<sup>+</sup>.

*(E)-(1,1 -di-tert-butyl 6,6 -bis(4-{bis[4-(hexylsulfanyl)phenyl]amino}phenyl)-3,3 -dioxo-1H, 1 H,3H,3 H- [2,2 -biindolylidene]-1,1 - dicarboxylate)* (**6d**). Compound **11** (93 mg, 0.22 mmol, 1.0 eq.) was reacted with stannane **12c** (353 mg, 0.46 mmol, 2.1 eq). Purification (petroleum ether:EtOAc gradient from 50:1 to 10:1) gave **6d** (235 mg, 0.15 mmol) as a purple red solid (yield 68%). Due to rapid decomposition, compound 6d, could not be fully characterized. MS (ESI) m/z 1576.0

#### 3.3.3. General Procedure for the Preparation of Compounds **5a**–**c**

Compounds **6a**–**c** were dissolved in a 1:1 mixture of CH2Cl2 and TFA (5 mL) and the solution was left under stirring for 4 h at room temperature. The solvent was removed by rotatory evaporation, and the crude was purified by washing with petroleum ether or by flash column chromatography.

*(E)-6,6 -bis(thiophen-2-yl)-1H,1 H,3H,3 H-[2,2 -biindolylidene]-3,3 -dione* (**5a**) [45]. Deprotection of compound **6a** (70 mg, 0.11 mmol), after crystallization from petroleum ether, gave **5a** (44 mg, 0.10 mmol) as a green amorphous solid. Yield 93%. Spectroscopic data were in agreement with those already reported. [45] 1H-NMR (400 MHz, THF-*d*8) δH = 9.95 (2H, s), 7.64 (2H, d, J = 8.0 Hz), 7.55 (2H, dd, *J*<sup>1</sup> = 3.6 Hz, *J*<sup>2</sup> = 1.0 Hz), 7.52 (2H, d, *J* = 0.7), 7.49 (2H, d, *J* = 4.7), 7.27 (2H, dd, *J*<sup>1</sup> = 8.0Hz, *J*<sup>2</sup> = 1.4Hz), 7.12 (2H, dd, *J*<sup>1</sup> = 5.0Hz, *J*<sup>2</sup> = 3.6 Hz). 13C-NMR{1H} (100 MHz, THF-*d*8) δC 187.7, 154.0, 144.4, 141.9, 129.0, 127.4, 125.7, 124.9, 122.4, 119.7, 118.4, 109.7. FT-IR (neat): ν = 3344 (m), 3302 (m), 2954 (w), 2920 (m), 2850 (m), 1631 (s), 1610 (s), 1582 (s) cm<sup>−</sup>1. MS (ESI) *m*/*z* 427, 2 [M + H]+.

*(E)-6,6 -bis({3,3-dipentyl-2H,3H,4H-thieno[3,4-b][1,4]dioxepin-6-yl})-1H,1 H,3H,3 H-[2,2 -bis-indolylidene] -3,3 -dione* (**5b**). After purification (petroleum ether:EtOAc gradient from 35:1 to 10:1, then pure EtOAc), deprotection of compound **6b** (105 mg, 0.10 mmol) gave **5b** (82 mg, 0.96 mmol) as a green amorphous solid. Yield 96%. 1H-NMR (200 MHz, CDCl3) δH = 9.17 (2H, br. s.), 7.61 (2H, d, *J* = 8.1 Hz), 7.48 (2H, s), 7.12 (2H, d, *J* = 8.1 Hz), 6.45 (2H, s), 3.95 (4H, s), 3.88 (4H, s), 1.17–1.43 (32H, m), 0.81–0.98 (12H, m) ppm. 13C-NMR{1H} (50 MHz, CDCl3) δC = 187.4, 152.2, 150.5, 147.9, 141.0, 124.4, 122.2, 120.6, 118.5,118.1, 109.3, 104.6, 77.5(2C), 65.8, 43.8, 32.7, 32.1, 22.5, 14.0 ppm. FT-IR (neat): ν = 3385 (w), 2954 (m), 2926 (m), 2857 (m), 1624 (m), 1604 (s), 1572 (m), 1438 (s) cm−1. HRMS (ESI) *m*/*z* calculated for C50H62N2O6S2: 851.4122. Found: 851.4145 [M + 1]+.

*(E)-6,6 -bis(4-{bis[4-(hexyloxy)phenyl]amino}phenyl)-1H,1 H,3H,3 H-[2,2 -biindolylidene]-3,3 -dione* (**5c**). After purification (petroleum ether:EtOAc gradient from 35:1 to 10:1, then pure EtOAc), deprotection of compound **6c** (60 mg, 0.045 mmol), gave **5c** (52 mg, 0.044 mmol) as a green amorphous solid. Yield 92%. 1H-NMR (200 MHz, CDCl3) δH = 9.03 (2H, br. s.), 7.68 (2 H, d, *J*= 8.2 Hz), 7.41 (4 H, d, *J* = 8.8Hz), 7.10–7.17 (4H, m), 7.07 (8H, d, *J* = 9.3 Hz), 6.94 (4H, d, *J* = 8.2 Hz), 6.84 (8H, d, *J* = 9.3), 3.94 (8H, t, *J* = 6.3Hz), 1.74–1.83 (8H, m), 1.43–1.52 (8H, m), 1.32–1.37 (16H, m), 0.90–0.94 (12H, m); 13C-NMR{1H} (50 MHz, CDCl3) δC = 187.9, 155.9, 152.5, 149.4, 148.7, 140.0, 130.8, 127.8, 127.1, 124.7, 122.2, 119.5, 118.2, 117.1, 115.35, 109.2, 68.2, 31.6, 29.3, 25.7, 22.6, 14.0. FT-IR (neat): ν = 3368 (w), 2952 (w), 2927 (m), 2857 (m), 1627 (m), 1594 (s), 1503 (s), 1444 (s) cm−1. HRMS (ESI) *m*/*z* calculated for C76H84N4O6: 1148.6391. Found: 1148.6415 [M]<sup>+</sup>.
