Re: BEST way to change 1 character in a file?
Re: BEST way to change 1 character in a file?
- Subject: Re: BEST way to change 1 character in a file?
- From: Malcolm Fitzgerald <email@hidden>
- Date: Thu, 13 Feb 2003 12:57:27 +1100
On Thursday, February 13, 2003, at 11:01 AM, Nitz, Chris wrote:
Hi, List.
I am picking up some text and saving to a file, using URL Access
Scripting.
When I save the file, I am discovering that the carriage returns are PC
returns (ascii character 10).
If I save the text using Internet Explorer, I get MAC returns (ascii
character
13), which is what I want.
My first thought was to use a linear (character-by-character search)
to find &
replace them, but there's a better way, I'm sure.
What is the fastest AppleScript way to make these PC carriage returns
(in a
.txt file) become MAC returns (ascii character 13)?
-- it may not be the fastest
-- but it's all done in three lines
set AppleScript's text item delimiters to ASCII character 13
set return to ASCII character 10
-- given that the text to convert is in s
set s to (every paragraph of s) as string
Malcolm Fitzgerald ph: 02 93180877
Database Manager fax: 02 93180530
The Australian Society of Authors www.asauthors.org
_______________________________________________
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.