Re: styled text to record, ok. But record to styled text?
Re: styled text to record, ok. But record to styled text?
- Subject: Re: styled text to record, ok. But record to styled text?
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 23 Jan 2004 18:15:00 -0800
On 1/23/04 5:47 PM, "Walter Ian Kaye" <email@hidden> wrote:
>
Christopher Stone sent me an email illustrating that a *list* would
>
work, although it requires special handling due to returning
>
{styledtext} upon reconversion (i.e., it becomes a 1-item list:
>
{text,styl} -> {stxt}). But since writing as list is special-cased
>
anyway, then un-listing afterwards just goes along with that.
>
Of course now I'm wondering which other seemingly-basic data types
>
would need similar special casing...
Writing to a file as list or as record are "self-defining" : very handy,
since no delimiter could work safely with them. (Any delimiter can, and
does, appear as a character within the binary data of lists, records and
dates - no ASCII character is exempt.) Dates, oddly, are not self-defining,
but they're always exactly 8 characters, so you can just 'read for 8'.
Integers are 1 character, so you can write them that way if you prefer that
to text representation.
Or, as Chris Nebel once pointed out to me, you could write your entire
hodgepodge of lists, records, dates, integers, reals, Unicode and strings
(anything I left out?) as one grand uber-list, and just read back the whole
thing 'as list', setting your list-of-variables to the result. Then deal
with each component separately.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.