How to put text from email message into a range of Spreadsheet cells?
I have a short script that collects some text from an email message which I then wish to place into a range of cells in an Excel spreadsheet.
So inside a try event I have this to get the text:
tell application "Mail"
set emailSelection to (get selection)
set theMessage to (item 1 of the emailSelection)
copy content of (item 1 of the emailSelection) to theText-- as string doesn't work generates compile error
set pasteText to (paragraphs from paragraph 4 to the last paragraph) of theText
end tell
followed by
tell application "Microsoft Excel"
clear range (range "A1:A50" of worksheet "TP from website" of workbook "Contacts Database (for script testing)")
copy pasteText
paste (rangeA1)
which was converted to
tell application "Microsoft Excel"
clear range (range "A1:A50" of worksheet "TP from website" of workbook "Contacts Database (for script testing)")
«event misccopy» pasteText
paste (rangeA1)
I guess a copy command needs two objects, one to the other from but not sure how to get my pasteText content into the spreadsheet.