• 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: Dialog from script application displays raw codes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Dialog from script application displays raw codes
      • From: kai <email@hidden>
  • Prev by Date: [ann] Appscript Installer 1.4.1 released
  • Next by Date: Re: Look for prefix, if no match display alert.
  • Previous by thread: [ann] Appscript Installer 1.4.1 released
  • Next by thread: Re: Dialog from script application displays raw codes
  • Index(es):
    • Date
    • Thread