• 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: newbie problem with lists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newbie problem with lists


  • Subject: Re: newbie problem with lists
  • From: otusweb <email@hidden>
  • Date: Fri, 07 Jun 2002 09:35:40 -0500

if you want it to display in alphabetical order, you'll need to sort them and them display them.

look into the apple guidebooks on the list subject one of those contain a scnippet on how to move object in a list. Then perform a bubble sort (compare one object with next one if the first is supposed to be higher than the second, then swap them, then compare it again with the next one so that it bubble up the list until it reaches a point where it cannot go higher, do that until there are no more item to move)

Olivier
here is an example of double bubble sort that i use to sort card in a stack for an app, i'm sure you can get what you want from it.

on SortCard(inStack) -- based on a double bubble sort
set again to true
set iloopvar to 1
tell application "TI StudyCards Creator"
repeat while again is true and iloopvar is less than (count of card in inStack) + 1
set jLoopVar to count of card in inStack
set again to false
repeat while jLoopVar is greater than iloopvar
if name of card jLoopVar of inStack is less than name of card (jLoopVar - 1) of inStack then
move card jLoopVar of inStack to before card (jLoopVar - 1) of inStack
set again to true
end if
set jLoopVar to jLoopVar - 1
-- your statements
end repeat
set iloopvar to jLoopVar + 1
-- your statements
end repeat
end tell
end SortCard


John Clark wrote:

I need to concatenate two lists...easy

set newlist to list1 & list2
choose from list newlist

How then can I get newlist to display alphabetically

dumb photographer

Thanks for the help on the previous newbie


regards


John Clark

82 Heathwood Gdns
London
SE7 8ER

0208 854 4069
07702 627 237
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >newbie problem with lists (From: John Clark <email@hidden>)

  • Prev by Date: Re: Questions
  • Next by Date: Re: Text encoding convertions
  • Previous by thread: newbie problem with lists
  • Next by thread: Re: Newbie problem with lists
  • Index(es):
    • Date
    • Thread