Re: strings and strings (was Don't get it.)
Re: strings and strings (was Don't get it.)
- Subject: Re: strings and strings (was Don't get it.)
- From: Peter Waibel <email@hidden>
- Date: Thu, 14 Dec 2006 11:40:24 +0100
I've forgotten the details, but IIRC a string can contain 'pure'
characters,
or also additional formatting information. You can't see what
you're dealing
with by just looking at the class. Usually the latter is the
problem: people
use a trick of coercing to list and then coerce the first list item
back to
string again, to drop the extraneous information. How to manipulate
things in
the other direction in 'vanilla' AS I don't know.
Somewhere I found the handler "AsText".
As far as I know this handler is from Arthur Knapp.
on AsText(str)
--coerce Unicode or other text to styled string to plain text
try
return (((str as string) as record)'s «class ktxt»)
end try
return str -- if plain text to begin with
end AsText
The result of AsText is a pure 8 bit string.
Peter _______________________________________________
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/mailman//archives/applescript-users
This email sent to email@hidden