• 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: Can someone explain this?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can someone explain this?


  • Subject: Re: Can someone explain this?
  • From: Philip Aker <email@hidden>
  • Date: Sun, 15 Mar 2009 04:22:08 -0700

On 2009-03-14, at 16:05:03, Nigel Garvey wrote:

Philip Aker wrote on Sat, 14 Mar 2009 07:32:31 -0700:

On 2009-03-14, at 07:21:58, Michelle Steiner wrote:
This doesn't:

set the outputFile to (choose file name with prompt "Choose where to
save the file" default name "test.txt" default location (path to
desktop))
set myList to {"a", "b", "c", pi as text, "finished"}
set fref to open for access outputFile with write permission
write ((items 2 through the end of myList) as text) to fref
close access fref

I can confirm this error on 10.5.6. Sounds like a parsing bug to me. You can reduce the problem to:

set myList to {"a", "b", "c", pi as text, "finished"}
items 2 thru the end of myList

and file a bug report at <https://bugreport.apple.com/>.

It's the same on my Jaguar machine and I think I remember it from when I was using OS 8.0 eleven years ago.

I was curious about the behavior on the MacOS systems Nigel but am hard pressed to remember that far back in AppleScript because my focus at the time was on C++.



Obviously the parser's being confused by the fact that the 'the' is in front of the second boundary index in a range reference. It's assuming that 'the' is optional before 'end of myList', whereas the scripter's assuming that its "scope" (for want of a better word) only applies to 'end'. Putting parentheses round 'the end' makes the intention explicit, as does inverting the reference:


 set myList to {"a", "b", "c", pi as text, "finished"}
 myList's items 2 thru the end

Right. But I think Michelle covered the scoping variants implicitly by pointing out one of them in her first post. The question, it seems to me, is whether or not folks such as yourself will visit <https://bugreport.apple.com/ > to up the priority of said parsing bug. As previously noted, the only documented exception for the non-optionality of 'the' is 'the clipboard' and all other documented usage is optional. All in all, I think it would be better if 'the clipboard' migrated to 'pasteboard' and 'the' is always optional. Then there will be zero exceptions to remember and more time to concentrate on the scripting task at hand.



Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

_______________________________________________
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
  • Follow-Ups:
    • Re: Can someone explain this?
      • From: "email@hidden" <email@hidden>
    • Re: Can someone explain this?
      • From: Michelle Steiner <email@hidden>
References: 
 >Re: Can someone explain this? (From: "Nigel Garvey" <email@hidden>)

  • Prev by Date: Re: Can someone explain this?
  • Next by Date: Re: Stock Quotes using AppleScript
  • Previous by thread: Re: Can someone explain this?
  • Next by thread: Re: Can someone explain this?
  • Index(es):
    • Date
    • Thread