• 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: Why these errors?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why these errors?


  • Subject: Re: Why these errors?
  • From: has <email@hidden>
  • Date: Tue, 11 Feb 2014 19:02:52 +0000

Shane Stanley wrote:

>> OK, here you go:
>>
>> 10.6.8
>> {document file, document file}
>>
>> on 10.8.4
>> {disk, disk}
>>
>> on 10.9.1
>> {document file, class}
>
>So the claim that "it doesn't matter how many 'tell' blocks you wrap 'set b to class' in: none of them will have any effect" seems only to hold in Mavericks. Has AS been modified to match Hamish's expectations? Or did he do a sneak test before posting? Surely not.

Actually, it was more a slow, shuffling train of thought [1], rattling destination-ward thus:

1. Well, obviously, it SHOULD return {folder,folder}, because when AppleScript encounters one or more object specifiers that form a partial reference - i.e. one without a root - it automatically uses the current default target object as that root. That's how AppleScript is designed to resolve incomplete references after all.

2. Except... I bet Shane is trying to pull a fast one (I knew there's a reason we sent that lot to the colonies), so without being able to actually check I'm going to suspect it's {folder,class}.

3. And I do remember that while AppleScript sometimes has trouble knowing whether a given token is definitely an object specifier, or something else, in which case you have to help it out with an explicit '... of me/it' (or 'my/its ...'), from which it can deduce that it's definitely a specifier and should use the current script/current default target as its root.

4. So while I can't remember *exactly* which tokens it was that caused this problem, I bet Shane has used one that does just to see if he can trip me up. So $64,000 says it's {folder,class}, not {folder,folder}.

5. Let's confirm/revoke this hypothesis by testing it in ASE... Oh look, {folder,class} it is.

6. HAHA, STANLEY, IZ 2 L33T 4 UR TRIX!!!!


Wrote the email with an explanation of what was going on: terminology conflict confuses AS over whether 'class' keyword should be treated as a type name or property name in this particular use case, pointed out this still had absolutely sod all to do with how and where message sends get dispatched, and called it a night.

I only was able to test on 10.9, however, (I do have a couple 10.6 boxes for testing and stuff, but they're both out on loan), but I should've known the sneaky devilish sod would have one more card up his sleeve. Still I have to admit the 'repeat forever [set n to n + 1]' was an especially impressive trick. (Bravo! Don't get cocky, kid.:p)

Hmmm, also: since the original, intended/expected behavior worked fine up to 10.8.x, it starts to sound like Other Other Chris managed to ding the AS parser after all. (But accidents will happen, 'specially when blithely skipping round such a crazy-precarious house of cards.)


Later,

has


[1] At insomniac o'clock at night, mind, so be thankful I even managed complete sentences.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


  • Prev by Date: Re: Resource folder of library script?
  • Next by Date: Re: Why these errors?
  • Previous by thread: Re: Why these errors?
  • Next by thread: " Display Dialog " without stopping script execution
  • Index(es):
    • Date
    • Thread