Hi, I am working on a script to create a calendar entry from a draft. I would like the first line of the draft be the title of the event and the rest of the draft to go into the notes / description field on the event. Here is the code I have:
event.title = draft.displayTitle;
event.notes = 'From Drafts App: ' + '\n' + draft.content;
draft.content contains both the displayTitle (first line) and the rest of the daft. I guess I would need to find a way in JavaScript to delete text from draft.content, like searching for first new line, the outputting the rest of draft.content to event.notes? Is there another way to accomplish this?