// Opens «Modifica…» on the general folder of Impostazioni → Esportazione (spec §4.10, tappa E2; composed from mockup 08 // and the dialogs of mockup 13), chooses «Uno schema suo» and changes the first scheme, so «Risultato» shows the tree. const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); let edit = null; for (let i = 0; i < 50 && !edit; i++) { edit = [...document.querySelectorAll('.cartella-impostazioni .btn')].find((b) => b.textContent.includes('Modifica')); if (!edit) await sleep(100); } edit.click(); let own = null; for (let i = 0; i < 50 && !own; i++) { own = document.querySelector('.dialogo.destinazione input[type=radio][value=suo]'); if (!own) await sleep(100); } own.click(); await sleep(400); const scheme = document.getElementById('schema-copie'); scheme.value = ['{account}', '{anno}', '{tipo}', '{data}_{ora}_{codice}_{n}'].join(String.fromCharCode(92)); scheme.dispatchEvent(new Event('input', { bubbles: true })); await sleep(1500); document.activeElement?.blur(); return document.querySelector('.dialogo.destinazione .albero')?.textContent.slice(0, 120);