@gpintop Very nice, could you share the script? Trying to get something going on my end similar to you. Currently playing with this: -- select the file
-- change this to a direct path if you prefer
set theFile to (choose file with prompt "Select the CSV file")
-- read the file contents:
set f to read theFile
-- break the file into paragraphs (c.f. rows)
repeat with row in (paragraphs of f)
-- parse the row into comma-delimited fields
set fields to parseCSV(row as text)
-- now you have your data:
set recipientAddress to item 1 of fields
set theSubject to item 2 of fields
set theContent to item 3 of fields
set recipientName to item 4 of fields
-- presumably you want to do something more with this data?
tell application "Mail"
set NewMail to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true}
set message signature of NewMail to signature "OG"
tell NewMail
make new to recipient with properties {name:recipientName, address:recipientAddress}
send
end tell
end tell
end repeat
on parseCSV(theText)
set {od, my text item delimiters} to {my text item delimiters, ","}
set parsedText to text items of theText
set my text item delimiters to od
return parsedText
end parseCSV
... View more