Re: even better coerce to record with usrf
Re: even better coerce to record with usrf
- Subject: Re: even better coerce to record with usrf
- From: email@hidden
- Date: Sat, 15 Dec 2001 06:42:10 -0500
On Fri, 14 Dec 2001 23:16:05 +0000, Nigel Garvey
<email@hidden> noted,
>
I notice
>
too that the type keywords within the "string" - eg. "TEXT", "usrf",
>
"long", "list", etc. - are all four bytes long and appear to start at
>
even boundaries. Possibly (I'm sure the experts here would know) these
>
are read as four-byte numbers and act as tokens for those data types - eg:
>
>
"TEXT"
>
= byte values $54, $45, $58, and $54 (hexadecimal)
>
= long value $54455854 (hexadecimal)
The four-byte type identifier, which the programmers call a type code
or resource type is a basic component of Mac programming. You have
-- Four-letter creator codes ('CARO' for Acrobat, 'R*ch' for BBEdit,
'MACS' for the Finder, 'ttxt' for SimpleText etc.),
-- Four-letter file types ('TEXT' for a text file, 'rsrc' for a resource
file, 'PDF ' for Adobe PDF [note the space after the F, to make four
characters], 'osax' for a Scripting Addition)
-- Four-letter resource types ('aete' for a dictionary, 'cicn' for a color
icon, 'PICT' for a Quickdraw picture)
-- Four-letter class identifiers for AppleScript types (like the
<<class usrf>> under discussion
-- Four-letter event ID and four-letter event class, that make up the
eight-character <<event xxxxyyyy>> AppleEvent codes.
and underneath this all, you have four-letter codes for all the data types that
can appear in Apple Events. These include codes things your are familiar with,
like 'bool' (boolean--true/false), 'fss ' (file specification), and 'alis'
(alias). But you usually don't see the codes because AppleScript replaces them
with the terminology defined in the various dictionaries.
Real Klingon programmers write their code with nothing but raw event codes.
tell <<class capp>> "Finder"
<<event aevtodoc>> <<class alis>> "Gragh:MyFile"
end tell
--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden