• 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: Really dumb question . . .
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Really dumb question . . .
      • From: Christopher Nebel <email@hidden>
References: 
 >Re: Really dumb question . . . (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: MySQL Question
  • Next by Date: Re: MySQL Question
  • Previous by thread: Re: Really dumb question . . .
  • Next by thread: Re: Really dumb question . . .
  • Index(es):
    • Date
    • Thread