• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Some line breaks aren't showing up when I try and make a list of paragraphs of email contents
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Some line breaks aren't showing up when I try and make a list of paragraphs of email contents


  • Subject: Some line breaks aren't showing up when I try and make a list of paragraphs of email contents
  • From: Alastair Leith <email@hidden>
  • Date: Wed, 26 Mar 2014 13:39:41 +1100

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:
     set cellText to {}
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
mailto:email@hidden?subject=Subscribe Foo&body=Please subscribe me to%Foo First Name: Last Name: Mobile No: Landline: Organisation: Position:

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: Steven
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
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Some line breaks aren't showing up when I try and make a list of paragraphs of email contents
      • From: Thomas Fischer <email@hidden>
    • Re: Some line breaks aren't showing up when I try and make a list of paragraphs of email contents
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: AppleScript Editor and its windows.
  • Next by Date: Re: Some line breaks aren't showing up when I try and make a list of paragraphs of email contents
  • Previous by thread: Re: AppleScript Editor and its windows.
  • Next by thread: Re: Some line breaks aren't showing up when I try and make a list of paragraphs of email contents
  • Index(es):
    • Date
    • Thread