Online Scriptwriting Format Checker
Paste your script to check for common formatting errors.
Script Content
0 characters
Ready to Analyze?
Click the button below to check your script against standard screenplay formatting rules.
Formatting Analysis
Analyzing your script...
Your format analysis will appear here.
An error occurred during analysis. Please try again.
`; } finally { loader.classList.add('hidden'); loader.classList.remove('flex'); } }); // --- PDF Download Functionality --- pdfBtn.addEventListener('click', () => { const resultsHtml = formatResultsDiv.innerHTML; if (!resultsHtml || resultsHtml.includes("will appear here")) { showMessage('No analysis results to download.', 'error'); return; } try { const { jsPDF } = window.jspdf; const doc = new jsPDF(); doc.setFont('helvetica', 'bold'); doc.setFontSize(18); doc.text('Script Format Analysis Report', 105, 20, { align: 'center' }); doc.line(20, 25, 190, 25); // Use autoTable for a clean presentation of the list const listItems = Array.from(formatResultsDiv.querySelectorAll('li')).map(li => [li.textContent]); doc.autoTable({ startY: 35, head: [['Potential Formatting Issues and Suggestions']], body: listItems, theme: 'striped', headStyles: { fillColor: [79, 70, 229] }, // Indigo color }); doc.save('script-format-report.pdf'); showMessage('Report downloaded successfully!', 'success'); } catch (e) { console.error("Error generating PDF:", e); showMessage('Could not generate PDF. Please try again.', 'error'); } }); // --- Copy to Clipboard Functionality --- copyBtn.addEventListener('click', () => { const textToCopy = formatResultsDiv.innerText; if (!textToCopy || textToCopy.includes("will appear here")) { showMessage('There are no results to copy.', 'error'); return; } const textArea = document.createElement("textarea"); textArea.value = textToCopy; textArea.style.position = "fixed"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { document.execCommand('copy'); showMessage('Results copied to clipboard!', 'success'); } catch (err) { console.error('Copy failed:', err); showMessage('Could not copy text.', 'error'); } document.body.removeChild(textArea); }); // --- Custom Message/Alert Box --- const showMessage = (message, type = 'success') => { messageBox.textContent = message; messageBox.className = `message-box ${type}`; messageBox.classList.add('show'); setTimeout(() => { messageBox.classList.remove('show'); }, 3000); }; // Initialize view showTab(0); });