Re: Question about list structure
Re: Question about list structure
- Subject: Re: Question about list structure
- From: has <email@hidden>
- Date: Thu, 24 Nov 2005 18:57:02 +0000
Kevin Walzer wrote:
>I'm having problems getting a list correctly read in an AppleScript program I'm writing.
You've used the wrong line delimiter. Unix uses linefeeds, not carriage returns.
set theFinalOutput to read open_file using delimiter ASCII character 10
Alternatively, use:
set theIntermediateOutput to read open_file
set theFinalOutput to paragraphs of theIntermediateOutput
This is usually best [1] as it'll always work regardless of the particular linebreak scheme used (Windows/Unix/classic Mac).
has
[1] Note: usual caveats apply regarding AS throwing a wobbly when there's more than approx. 4000 paragraphs in the file because AS's string type suuuuucks. Coercing it to Unicode text beforehand gets around this problem. Or if you're only going to iterate over it, don't bother splitting it into a list at all; just use 'paragraph i of theText'.
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
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