As a beginner in JXA, I am currently learning how to perform simple tasks in TextEdit. I have managed to extract the paragraphs of a document and store them as an array using the following code:
app = Application('TextEdit')
docPars = app.documents[0].paragraphs()
However, my challenge lies in figuring out how to reinsert the sorted paragraphs back into TextEdit as an array, essentially recreating the original multiple-paragraph document.
Thanks in advance.