• 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: I have a "write to file" dream
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I have a "write to file" dream


  • Subject: Re: I have a "write to file" dream
  • From: Eric Geoffroy <email@hidden>
  • Date: Fri, 04 Mar 2011 09:32:12 -0800
  • Thread-topic: I have a "write to file" dream

Thanks Paul, that's spiffy. Much, much nicer than piping out to 'tr \r \n

- Eric

> It's pretty easy to modify wordsandstuff to use whatever line endings you want
> in a couple of lines before you write it to file, even if you don't know what
> line endings it's starting out with:
>
> set theLines to paragraphs of wordsandstuff
> set {oldDelims, AppleScript's text item delimiters} to {AppleScript's text
> item delimiters, (return & linefeed)} -- CRLF
> set wordsandstuff to theLines as text
> set AppleScript's text item delimiters to oldDelims
>
> If you need to it work also pre-OS 10.5, use "\n" instead of linefeed.
>
> If (as you should) you always set text item delimiters before setting a list
> to to text, you can forget about oldDelims and lose a line of script.
>
> --
> Paul Berkowitz



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: I have a "write to file" dream
      • From: Christopher Stone <email@hidden>
  • Prev by Date: Mail.app Rule to copy subject and body to a new message?
  • Next by Date: Re: I have a "write to file" dream
  • Previous by thread: Re: I have a "write to file" dream
  • Next by thread: Re: I have a "write to file" dream
  • Index(es):
    • Date
    • Thread