• 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: Results differ in editor and applet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Results differ in editor and applet


  • Subject: Re: Results differ in editor and applet
  • From: Paul Berkowitz <email@hidden>
  • Date: Thu, 26 Feb 2004 10:26:25 -0800

On 2/26/04 9:17 AM, "Mr Tea" <email@hidden> wrote:

> When I run this in a script editor...
>
> tell application "iTunes"
> set c to class of current track as string
> my dlog(c)
> end tell
>
> on dlog(c)
> display dialog c
> end dlog
>
> ... the dialog displayed is "audio CD track"
>
> But, when the same script is run as an applet, it displays "<<class cCDT>>"
>
> Why the difference? Why!?

The "Englishy" keywords aren't preserved outside their own context
(application tell block). The same thing happens when you export application
constants (e.g. 'highest as string' in Entourage, referring to priority of a
task or message) to a text file. I think that script editors preserve the
context somehow while you're in them - I'm not clear on this.

To make the app's dictionary accessible to the script, include this near the
top of the script, before you call the application:

run script "tell application \"iTunes\"
end tell"


Naturally you don't want to be doing this hundreds of times per script (its
slow), so don't put it in a repeat loop. Just once, near the top of the
script.

--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Results differ in editor and applet
      • From: Mr Tea <email@hidden>
References: 
 >Results differ in editor and applet (From: Mr Tea <email@hidden>)

  • Prev by Date: Re: Folder Actions & FileMaker backups
  • Next by Date: Re: InformationWindow: How do I get info from ...
  • Previous by thread: Results differ in editor and applet
  • Next by thread: Re: Results differ in editor and applet
  • Index(es):
    • Date
    • Thread