// «Copia in…» on the whole Libreria, from the menu of the CSV icon (spec §4.10, §10.3, tappa E2; composed from the // dialogs of mockup 13 and mockup 09): the summary line, one row per folder the files go to, «Copia di nuovo anche i N // tolti o superati» unchecked. Nothing is started. const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); const button = () => [...document.querySelectorAll('.strumenti button')].find((b) => (b.getAttribute('aria-label') || '').startsWith('Esporta')); for (let i = 0; i < 50 && !(button() && document.querySelector('.tess[data-id]')); i++) await sleep(100); button().click(); await sleep(400); [...document.querySelectorAll('.menu button, .menu [role=menuitem]')].find((x) => x.textContent.includes('Copia'))?.click(); for (let i = 0; i < 100 && !document.querySelector('.dialogo.copia-in .riepilogo-copia'); i++) await sleep(100); await sleep(300); document.activeElement?.blur(); return document.querySelector('.dialogo.copia-in .riepilogo-copia')?.textContent;