I have some line breaks hiding from me in email contents and presumably I need to change text delimiters to flush them out but not sure what I can set text delimiters to to do it. It's caused by me using "0D
%" for some line breaks in the email form I generate with an HTML "mailto:" command instead of "0D
" The later seem to register inside Apple Script as a line break but the former do not.
This is how I process other emails coming from the website form and it all works fine: set pasteText to (paragraphs from paragraph n to the last paragraph) of theText -- not splitting paras at soft line breaks -- Then I parse into an Excel friendly format with:
repeat with p in pasteText set cellText's end to {p's contents} end repeat repeat 50 - (count cellText) times set cellText's end to {""} end repeat set r to "A1:A" & (count cellText)
Another set of emails are reply emails from an HTML mailout I send. I create a blank form in the email using an HTML mailto: statement as follows
People click the link and then fill-out the email form. But only the first line break of the form registers in Script Debugger as a \n line break. If you examine the variable in it's own window it all looks normal but when it is compressed to a single line item in the variables tab it's evident some line breaks are registering (0D
) as "\n" and the others are not breaking at all (0D
%). I can fix the HTML in the next mailout I do but is there any way I can find these pesky line breaks in the 50 or so emails I need to process?
Presumably it involves setting text delimiters to something else but not sure what that something else is
Here is an example of the pasteText variable I was able to copy out of the Script Debugger Variables tab to show how I'm missing many of the line breaks that seem to appear when you look at the variables in their own window. Double line breaks seems to be the culprit. Highlights in red where "\n" should be
" \n\nPlease subscribe me to Journal\nFirst Name: Steve n
Last Name: Dank
Mobile No:
Landline:
Organisation: Performance Enhancing Science
Position: Director of PEDs\n\nSteven Dank
Works Engineer
Golden Plains Shire Council
P: 03 5555 5555 | M: 0427 111 111 | F: 03 5555 5555
E: email@hidden | W: madeup.com.au\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n________________________________________________\nThink before you print to save energy and paper. Do you really need to print this email? If you do, print it double sided.\nThe information in this electronic mail is privileged and confidential. It is intended only for use by the individual or entity named.
And the email copied from Mail.app: Please subscribe me to Terra Publica First Name: Steven Last Name: Dank Mobile No: Landline: Organisation: Performance Enhancing Science Position: Director of PEDs
Steven Quick Director of PEDs Performance Enhancing Science P: 03 5555 1111 | M: 0427 111 111 | F: 03 5555 5555 E: sdank@madeup.com.au | W: madeup.com.au
________________________________________________ Think before you print to save energy and paper. Do you really need to print this email? If you do, print it double sided. The information in this electronic mail is privileged and confidential. It is intended only for use by the individual or entity named.
Thanks Alastair |