• 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: Mr Tea <email@hidden>
  • Date: Thu, 26 Feb 2004 20:08:34 +0000

This from Paul Berkowitz - dated 26/2/04 6.26 pm:

> 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"

This works (thanks, Paul), but I don't really understand why. Is this
another piece of undocumented AS esoterica?

I thought I had covered the problem of Englishy key words not being
'preserved outside their own context' by converting the key words 'audio CD
track' to the string '"audio CD track"'.

If an applet tells iTunes to get the class of the current document and
convert it to a string, surely that command is happening inside the iTunes
application tell block in the applet, just as it's happening inside the same
tell block when run from Script Editor, Script Debugger, or Smile, and the
string that gets exported to the handler should be the same in either
case...

Maybe one of the AS insiders here could explain it?



Nick
pp Mr Tea

--
_______________________________________________
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: Shane Stanley <email@hidden>
    • Re: Results differ in editor and applet
      • From: Chris Espinosa <email@hidden>
References: 
 >Re: Results differ in editor and applet (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: Working with QuarkXPress bounds
  • Next by Date: 2 queries - file/creator type and do shell "rm"
  • Previous by thread: Re: Results differ in editor and applet
  • Next by thread: Re: Results differ in editor and applet
  • Index(es):
    • Date
    • Thread