Re: (ascii 10 ascii 13) --> (ascii 13) in Tex-Edit?
Re: (ascii 10 ascii 13) --> (ascii 13) in Tex-Edit?
- Subject: Re: (ascii 10 ascii 13) --> (ascii 13) in Tex-Edit?
- From: Michelle Steiner <email@hidden>
- Date: Sun, 18 Mar 2001 21:54:38 -0800
On 3/18/01 8:02 PM, Bill Christens-Barry <email@hidden> wrote:
>
A number of text files I download contain the character pair (ascii
>
10 ascii 13) as a line terminator, and I can't seem to find a way to
>
use Tex_Edit's dictionary to replace these with (ascii 13).
How about using Applescript's text handling features?
set fileToBeProcessed to choose file of type {"TEXT"}
set fileRef to open for access fileToBeProcessed with write permission
set textToBechanged to read file fileRef
set charpair to (ASCII character 10) & return
set {tid, text item delimiters} to {text text item delimiters, charpair}
set textItems to text items of textToBechanged
set text item delimiters to return
set textToBechanged to textItems as text
set text item delimiters to tid
set eof fileRef to 0
write textToBechanged to fileRef starting at 0 as text
close fileRef
set text item delimiters to tid
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------