• 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: lists and items and position of items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lists and items and position of items


  • Subject: Re: lists and items and position of items
  • From: yvan-koenig <email@hidden>
  • Date: Fri, 11 Mar 2005 10:48:53 +0100


Le 11 mars 2005 , à 9:50, Christian Vinaa a écrit :

based on Apples example:

on list_position(this_item, this_list)
	repeat with i from 1 to the count of this_list
		if item i of this_list is this_item then return i
	end repeat
	return 0
end list_position

set xList to {}

set this_list to {"Sal", "Sue", "Bob", "Carl"}
repeat with x in this_list
	set y to list_position(x, this_list)
	copy y to end of xList
end repeat

get xList

Hello

You made an error
after "repeat with x in this_list"
x is not a string but a reference to a string.


repeat with x in this_list set xx to x as text set y to list_position(xx, this_list) copy y to end of xList end repeat

will solve the problem.

Yvan KOENIG


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >lists and items and position of items (From: Christian Vinaa <email@hidden>)

  • Prev by Date: RE: check a folder for folders and files
  • Next by Date: Script for the monitor pref pane
  • Previous by thread: lists and items and position of items
  • Next by thread: Re: lists and items and position of items
  • Index(es):
    • Date
    • Thread