Re: Really dumb question . . .
Re: Really dumb question . . .
- Subject: Re: Really dumb question . . .
- From: Adam Wuellner <email@hidden>
- Date: Wed, 27 Jul 2005 13:35:55 -0500
On 7/27/05, Mark J. Reed <email@hidden> wrote:
> On the subject of I/O, though, is there a built-in easy way to write text
> with a trailing newline included? I've been using e.g.
>
>
> write "Hello, world!" & ascii character 10 to fd
No, but you could use the 'return' keyword, which in that context acts
as a constant specifying a newline (actually, I'm not certain if it is
\r or \n, but it's always served me well enough that I never had to
bother finding out).
write "Hello, world" & return to fd
Fewer keystrokes, and cleaner depending on your tastes.
You could write a handler
on write_line(the_string, the_file)
write the_string & return to the_file
end write_line
If ya wanted to get fancy, you could have it not append a return if
the string already ends with a return... design decision, up to you.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden