Re: carriage return & line feeds
Re: carriage return & line feeds
- Subject: Re: carriage return & line feeds
- From: Christopher Nebel <email@hidden>
- Date: Thu, 7 Jun 2001 14:11:59 -0700
On Thursday, June 7, 2001, at 07:29 AM, Jonathan Neff wrote:
Thanks to all that sent help on this. Of course, I knew what was
needed,
but was trying to do it with "\n" or something similar. Too much PERL
recently, i guess.
I changed the relevant line to this and all appears to be working well.
write [sometext here] & return & (ASCII character 10) to fileRef
Just to beat this into the ground, the traditional line-end values are:
Mac OS: ASCII character 13 (aka "\r", aka carriage return)
Unix: ASCII character 10 (aka "\n" to Perl and C users, aka line feed)
Windows: ASCII character 13 & ASCII character 10 (aka "\r\n", aka crlf)
AppleScript doesn't support the literal "\n" in strings, but a future
release will.
Decent text editors don't care which line ending style you use, as long
as you're consistent. (And some don't even require that!) BBEdit and
TextEdit on Mac OS X, for example, both work fine with all the
variants. Fussier editors (e.g., vi on Unix, and I think WordPad on
Windows) require that you use the "right" style.
--Chris Nebel
AppleScript Engineering