// Opens in the viewer a photo whose copy was taken away from the folder, with the copy row and «Copia di nuovo» in the // File panel (spec §4.10, tappa E2; composed from mockup 02). The address chooses «Copie: Tolti o superati». const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); for (let i = 0; i < 50 && !document.querySelector('.tess[data-id]'); i++) await sleep(100); document.querySelector('.tess[data-id]').click(); const wanted = () => { const text = document.querySelector('.vis')?.innerText || ''; return text.includes('Copia di nuovo') && !text.includes('non è sul disco') && /\n(Post|Storia), foto/.test(text); }; await sleep(1500); for (let i = 0; i < 40 && !wanted(); i++) { document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowRight', bubbles: true })); await sleep(900); } await sleep(600); return document.querySelector('.vis .dove')?.textContent;