Re: Dialog from script application displays raw codes
Re: Dialog from script application displays raw codes
- Subject: Re: Dialog from script application displays raw codes
- From: has <email@hidden>
- Date: Mon, 28 Aug 2006 16:12:53 +0100
kai wrote:
However, in cases where we want to use internal definitions in text
form, such as in a dialog, we need a way of forcing the compiler to
decompile raw codes like «class cfol» and «class docf» into their
more readily recognised terms: "folder" or "document file".
I think you meant to say "interpreter", not "compiler". The AS
compiler isn't involved in running scripts, either in Script Editor
or in an applet.
To clarify:
What's happening is that when you open/compile a script in Script
Editor, the AS compiler loads the terminology for all the
applications used in that script. Once loaded, the AS component
retains that terminology in an internal cache which both the compiler
and interpreter have subsequent access to.
When the AS interpreter performs the type class-to-string coercion in
line 2, it checks the cached terminologies for a matching keyword. If
it finds one it uses it, otherwise it falls back to using the raw
representation.
When you run an applet, there's no cached terminologies available to
the AS interpreter except for AppleScript's own. (The interpreter
doesn't load terminologies for efficiency's sake.) But as you've
shown, you can force the AS component to load and cache additional
terminologies by compiling on-the-fly a script that refers to the
application(s) you want, after which that terminology is available to
the interpreter as well.
HTH
has
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden