Re: Coercing Styled Text to Text
Re: Coercing Styled Text to Text
- Subject: Re: Coercing Styled Text to Text
- From: Christopher Nebel <email@hidden>
- Date: Thu, 14 Jun 2001 23:44:58 -0700
On Thursday, June 14, 2001, at 01:55 AM, Ehsan Saffari wrote:
on error message
set message to <<class ktxt>> of (message as record)
or a slightly differnt variation
set plainTxt to item 1 of (((stylTextObj) as record) as list)
This variation is an extremely bad idea. Record items are not
guaranteed to be in any particular order and are subject to change. If
you rely on their position, your script may break in the future, whereas
the original that uses the key will be fine. (And before you say
"that'll never happen," it just did to someone using "info for" in this
way!)
--Chris Nebel
AppleScript Engineering