Re: I have a "write to file" dream
Re: I have a "write to file" dream
- Subject: Re: I have a "write to file" dream
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 03 Mar 2011 12:29:56 -0800
- Thread-topic: I have a "write to file" dream
Title: Re: I have a "write to file" dream
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
From: Eric Geoffroy <email@hidden>
Date: Thu, 03 Mar 2011 12:13:34 -0800
To: AppleScript-Users <email@hidden>
Subject: I have a "write to file" dream
Today we have this-
write wordsandstuff to fileRef as «class utf8»
but wouldn't this be super awesome-
write wordsandstuff to fileRef as «class utf8» with line-endings LF
and
write wordsandstuff to fileRef as «class utf8» with line-endings CRLF
_______________________________________________
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
_______________________________________________
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