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: Walter Ian Kaye <email@hidden>
- Date: Fri, 23 Jan 2004 18:57:51 -0800
At 06:15p -0800 01/23/2004, Paul Berkowitz didst inscribe upon an
electronic papyrus:
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,
And, apparently, a list functions as a "protective armor" which
protects the styled text from losing its styles. (It took me a while
to figure out that that's what's going on; so it wasn't {text,styl}
to begin with, as I previously thought.) Very handy indeed.
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,
Well, shorts are.
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?)
Only about a hundred. ;) Well, dozens for sure.
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.
-boo
_______________________________________________
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.