Turns a scanned PDF into text you can search, copy and edit, written into a Google Doc page by page.
UsesExtend
Google DocsiLovePDF
Turn a multi-page scan into readable text
scanFile to blank.Set scanFile to blank.scanLanguage to eng.Set scanLanguage to eng.transcriptDocument to blank.Set transcriptDocument to blank.maxPages to 40.Set maxPages to 40.firstPage to 1.Set firstPage to 1.transcriptDocument and save it as documentLink.Trim transcriptDocument and save it as documentLink.transcriptId to documentLink.Set transcriptId to documentLink.documentLink contains /d/If documentLink contains /d/Yes
documentLink split by /d/ split by / and save it as transcriptId.Get the first item of the last item of documentLink split by /d/ split by / and save it as transcriptId.Else if @documentLink contains "/"
Otherwise
No steps
transcriptId is emptyIf transcriptId is emptyYes
No
No steps
maxPages to the nearest integer and save it as pageLimit.Round maxPages to the nearest integer and save it as pageLimit.firstPage to the nearest integer and save it as startPage.Round firstPage to the nearest integer and save it as startPage.scanFile Save it as scanInfo.Read scanFile Save it as scanInfo.scanInfo.pages, or 0 if it is empty and save it as pageCount.Use scanInfo.pages, or 0 if it is empty and save it as pageCount.pageCount is less than 1If pageCount is less than 1Yes
No
No steps
startPage is greater than pageCountIf startPage is greater than pageCountYes
pageCount pages, so there is nothing from page startPage on. Set 'firstPage' to 1, or to the page after the last one written, then run it again.Stop and report a problem: The scan has pageCount pages, so there is nothing from page startPage on. Set 'firstPage' to 1, or to the page after the last one written, then run it again.No
No steps
pagesAfterFirst to pageLimit minus 1.Set pagesAfterFirst to pageLimit minus 1.lastPage to startPage plus pagesAfterFirst.Set lastPage to startPage plus pagesAfterFirst.lastPage is greater than pageCountIf lastPage is greater than pageCountYes
lastPage to pageCount.Change lastPage to pageCount.No
No steps
scanFile. Save it as searchableScan.Run OCR on scanFile. Save it as searchableScan.searchableScan.document_ref and save it as searchableRef.Trim searchableScan.document_ref and save it as searchableRef.searchableRef is null or searchableRef is emptyIf searchableRef is null or searchableRef is emptyYes
No
No steps
readPages.Parse a document. Save it as readPages.readPages.file_name and save it as scanTitle.Trim readPages.file_name and save it as scanTitle.scanTitle is null or scanTitle is emptyIf scanTitle is null or scanTitle is emptyYes
scanTitle to Scanned document.Change scanTitle to Scanned document.No
No steps
pagesFound to 0.Set pagesFound to 0.pagesWritten to 0.Set pagesWritten to 0.pagesBlank to 0.Set pagesBlank to 0.pagesFailed to 0.Set pagesFailed to 0.lastWriteProblem to blank.Set lastWriteProblem to blank.today.Get today's date and save it as today.today readable as โMonday, November 2, 2026โ and save it as readDate.Make today readable as โMonday, November 2, 2026โ and save it as readDate.headingErrorIf a step below fails, save the error as headingErrorTry
transcriptId. Save it as spacer.Add text to transcriptId. Save it as spacer.readDate' to transcriptId. Save it as scanHeading.Add the heading '@scanTitle, read on readDate' to transcriptId. Save it as scanHeading.On error
headingError.message.Show in the output: The heading for this scan could not be written: headingError.message.page in readPages.chunks:For each page in readPages.chunks:pagesFound.Add 1 to pagesFound.pagesWritten is greater than or equal to pageLimitIf pagesWritten is greater than or equal to pageLimitYes
No
No steps
page.content and save it as pageText.Trim page.content and save it as pageText.pageText is null or pageText is emptyIf pageText is null or pageText is emptyYes
pagesBlank.Add 1 to pagesBlank.No
No steps
(?m)^[ \t]*#{1,6}[ \t]+|^[ \t]*\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)*\|?[ \t]*(?:\n|$)|^[ \t]*\|[ \t]*|[ \t]*\|[ \t]*$|\*\* with in pageText and save it as plainText.Replace the pattern (?m)^[ \t]*#{1,6}[ \t]+|^[ \t]*\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)*\|?[ \t]*(?:\n|$)|^[ \t]*\|[ \t]*|[ \t]*\|[ \t]*$|\*\* with in pageText and save it as plainText.pageErrorIf a step below fails, save the error as pageErrorTry
page.page_start' to transcriptId. Save it as pageHeading.Add the heading 'Page page.page_start' to transcriptId. Save it as pageHeading.transcriptId. Save it as pageWritten.Add text to transcriptId. Save it as pageWritten.plainTextpagesWritten.Add 1 to pagesWritten.On error
pagesFailed.Add 1 to pagesFailed.lastWriteProblem to pageError.message.Change lastWriteProblem to pageError.message.page.page_start could not be written: pageError.message.Show in the output: Page page.page_start could not be written: pageError.message.pagesFound is 0If pagesFound is 0Yes
No
No steps
pagesWritten is 0 and pagesFailed is greater than 0If pagesWritten is 0 and pagesFailed is greater than 0Yes
lastWriteProblem). Check the link in 'transcriptDocument' and that your Google Docs connection can edit that Doc, then run it again.Stop and report a problem: No page could be written to your Google Doc (lastWriteProblem). Check the link in 'transcriptDocument' and that your Google Docs connection can edit that Doc, then run it again.No
No steps
pagesWritten is 0If pagesWritten is 0Yes
No
No steps
pagesMissing to pagesFound minus pagesWritten.Set pagesMissing to pagesFound minus pagesWritten.runSummary to pagesFound pages were read and pagesWritten were written. pagesBlank had no readable text and pagesFailed failed to write.Set runSummary to pagesFound pages were read and pagesWritten were written. pagesBlank had no readable text and pagesFailed failed to write.nextPage to lastPage plus 1.Set nextPage to lastPage plus 1.pagesLeftNote to blank.Set pagesLeftNote to blank.pageCount is greater than lastPageIf pageCount is greater than lastPageYes
Pages @nextPage to @pageCount of the scan were not read this time: set 'firstPage' to @nextPage and run it again to add them below, without repeating the pages... and save it as pagesLeftNote.Build the text Pages @nextPage to @pageCount of the scan were not read this time: set 'firstPage' to @nextPage and run it again to add them below, without repeating the pages... and save it as pagesLeftNote.No
No steps
pagesMissing is greater than 0 or pagesLeftNote isn't emptyIf pagesMissing is greater than 0 or pagesLeftNote isn't emptyYes
noteErrorIf a step below fails, save the error as noteErrorTry
transcriptId. Save it as noteWritten.Add text to transcriptId. Save it as noteWritten.[INCOMPLETE] runSummary@pagesLeftNote The pages above are not the whole scan.On error
noteError.message.Show in the output: The incomplete-scan note could not be written: noteError.message.pagesFailed is greater than 0If pagesFailed is greater than 0Yes
runSummary plus pagesLeftNote.Stop and report a problem: runSummary plus pagesLeftNote.No
runSummary plus pagesLeftNote.Finish the run: runSummary plus pagesLeftNote.No
runSummary.Show in the output: runSummary.