• 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: "email@hidden" <email@hidden>
  • Date: Sat, 14 Mar 2009 07:59:27 -0700

Here is a simplified version of the script that illustrates the problem.

I'm surprised any of these work. The command "the end of myList" returns the last item, not the index of the last item.

In these cases I've always used -1 to indicate the last item of a list.

Also, "the" is almost always optional, but there are many cases where it would interfere. You wouldn't insert in inside a multiple word command, for example, which may be what's happening here. I'm just guessing the compiler is trying to sort out the difference between asking for the last item and the index for the last item, and does a pretty good job until it hits "the end".

HTH,

ES
------------------
set myList to {"a", "b", "c", pi as text, "finished"}
--these work
log (items 2 through end of myList) as text
log (items 2 through (the end) of myList) as text
log items 2 through end of myList as text
log items 2 through (the end) of myList as text

-- This doesn't:
log (items 1 through the end of myList)

-- but look at this
log (the end) of myList


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

Done.

-- Michelle

 _______________________________________________
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

References: 
 >Can someone explain this? (From: Michelle Steiner <email@hidden>)
 >Re: Can someone explain this? (From: Philip Aker <email@hidden>)
 >Re: Can someone explain this? (From: Michelle Steiner <email@hidden>)

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