• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Text without formatting (OS 9.1)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text without formatting (OS 9.1)


  • Subject: Re: Text without formatting (OS 9.1)
  • From: Richard 23 <email@hidden>
  • Date: Fri, 2 Mar 2001 01:47:48 -0800

CAUTION: this post begins to delve into gibberish propellor-speak!

>There's Richard 23's brilliant method:
>
> set plainText to <<class ktxt>> of (formattedText as record)
>
Thanks I'll take it as a compliment.

>This is very fast, but it's not something you're officially able to do so
>it might break at a later date. (But then, things that you *are*
>officially able to do have been known to change, so don't let that deter
>you.) It'll also error if formattedText turns out not to be formatted
>after all.

Actually the first reference I could find to 'ctxt' was in an Apple
Event Registry document dated Winter 1992. It's been around for awhile!

'ktxt' is referred to by the Registry as keyAEText, as opposed to cText
for 'ctxt' if that helps. =:)

Copy some styled text to the clipboard and run the following:

set theData to the clipboard
{the clipboard as record, theData as record}

--> {{string: "hello", styled Clipboard text: <<data styl0015...>>},
{<<class ktxt>>: "hello", <<class ksty>>: <<data styl0015...>>}}

I'm not sure why they're different, but string is "TEXT" and text is
"ctxt".
So I have always gone with the 4 character code method.

Although the little known "best type" property seems to agree with you
about "string" aka "TEXT".

set theData to the clipboard
set theText to <<class ktxt>> of (result as record)
return result's <<class pbst>> -- looks like Pabst...
--> string

As string and text are synonymous it shouldn't make any difference...
I just don't take any chances with it.

Since I'm already going afield I may as well get this off my chest:

{class, <<class pbst>>} of {1,2,3}
--> {list, vector}

first file of application "Finder"
result's {class, <<class pbst>>}
--> {clipping, reference}

R23


  • Prev by Date: Re: Records
  • Next by Date: Re: Selecting every item of one disk's desktop
  • Previous by thread: Re: Text without formatting (OS 9.1)
  • Next by thread: Re: Text without formatting (OS 9.1)
  • Index(es):
    • Date
    • Thread