• 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
Re: BEST way to change 1 character in a file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: eudora connect script
  • Next by Date: Re: New Safari beta
  • Previous by thread: BEST way to change 1 character in a file?
  • Next by thread: Re: BEST way to change 1 character in a file?
  • Index(es):
    • Date
    • Thread