• 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: text 1 thru the result
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: text 1 thru the result


  • Subject: Re: text 1 thru the result
  • From: "Mark J. Reed" <email@hidden>
  • Date: Mon, 6 Dec 2010 17:42:41 -0500

Your negative example was also in Luther's original email as an example of something that works.  It's specifically "result" that has the problem; for some reason it seems to be some sort of reference type, which has to be resolved by either casting or "get" before one can use it as an endpoint in a subscript range.

On Mon, Dec 6, 2010 at 4:41 PM, Mel Charters <email@hidden> wrote:
On the other hand

property testList : characters of "abcdefghijklmnopqrstuvwxyz" -- a list of characters

-- test 1
set n to (-10 as integer)
items n thru 26 of testList --> {"q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}
-- test 2
set n to (10 as integer)
items n thru 26 of testList --> {"j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}

Mel Charters




On Dec 6, 2010, at 12:08 PM, Luther Fuller wrote:

This is not just a problem with text. It is a more general problem with lists.
A small change to the original script yields this ...

property testList : characters of "abcdefghijklmnopqrstuvwxyz" -- a list of characters

-- test 1
set n to (-10 as integer)
items 1 thru n of testList --> {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q"}

-- test 2
(10 as integer)
items 1 thru -(the result) of testList --> {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q"}

-- test 3
(-10 as integer)
items 1 thru (get the result) of testList --> {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q"}

-- test 4
(-10 as integer)
items 1 thru (the result) of testList --> Can’t get 1 {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"} thru -10 of item.

It has exactly the same problem.

_______________________________________________
Do not post admin requests to the list. They will be ignored.

Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


 _______________________________________________
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



--
Mark J. Reed <email@hidden>

 _______________________________________________
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: text 1 thru the result
      • From: Alex Zavatone <email@hidden>
References: 
 >text 1 thru the result (From: Luther Fuller <email@hidden>)
 >Re: text 1 thru the result (From: Axel Luttgens <email@hidden>)
 >Re: text 1 thru the result (From: Luther Fuller <email@hidden>)
 >Re: text 1 thru the result (From: Mel Charters <email@hidden>)

  • Prev by Date: Re: text 1 thru the result
  • Next by Date: Re: text 1 thru the result
  • Previous by thread: Re: text 1 thru the result
  • Next by thread: Re: text 1 thru the result
  • Index(es):
    • Date
    • Thread