Re: Carriage return hassles in Entourage
Re: Carriage return hassles in Entourage
- Subject: Re: Carriage return hassles in Entourage
- From: Graff <email@hidden>
- Date: Wed, 11 Feb 2004 11:42:58 -0500
The easiest way I know is this kind of snippet:
--------
-- theText holds the text you want to strip odd line endings from
set {oldDelims, AppleScript's text item delimiters} to {AppleScript's
text item delimiters, return}
set strippedText to (every paragraph of theText) as text
set AppleScript's text item delimiters to oldDelims
--------
- Ken
On Feb 10, 2004, at 11:46 PM, Dan Doughtie wrote:
I have an Applescript triggered by a rule in Entourage that removes
unwanted
carriage returns at the end of each line. I use wildcards to replace
punctuation/carriage return combos, then strip out all carriage
returns then
go back and replace the punctuation/carriage returns (assuming that a
period
(question mark etc) followed by a carriage return is the end of a
paragraph.
Not 100% but close enough.
Then the script writes out a text file that an app monitors that
inserts it
into a database. (the App is Mac based running on an XServe)
Generally the script has been agnostic between Mac, PC, HTML mail etc.
Until
today. ASCII 13 and 32 both would generate carriage returns. But now a
return in the script (created by literally hitting return on the
keyboard
and making sure that the tabs that usually come with it are removed)
generates an ASCII 32 and not a ASCII 13. No matter what kind of
search and
replace I do within the script it comes out 32 and this messes up the
inserter. The unwanted carriage returns aren't touched so the unwanted
carriage returns are still there. I've tried using pure ascii characer
calls
but didn't work. This script has worked flawlessly for months then bam.
The search and replace routines is based on apples generic
replace_chars(text, text) subroutine and their write file routine.
I'm running 10.3.2.
Anyway to force the various carriage returns from different OS's to be
a
"Mac" carriage return?
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.