• 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: Subroutine difference in script editor and project builder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Subroutine difference in script editor and project builder


  • Subject: RE: Subroutine difference in script editor and project builder
  • From: "Dan McCann" <email@hidden>
  • Date: Thu, 21 Aug 2003 12:33:33 -0700

Jay

I'm not sure what the problem is, but it seems the NS array stuff doesn't
understand "number of items" to find the length of the array. If you ask
for the length using "length" rather than "number of items" the script works
ok:

on ASCII_Sort(my_list)
set the index_list to {}
set the sorted_list to {}
repeat (length of my_list) times
set the low_item to ""
repeat with i from 1 to (length of my_list)
if i is not in the index_list then
set this_item to item i of my_list as text
if the low_item is "" then
set the low_item to this_item
set the low_item_index to i
else if this_item comes before the low_item then
set the low_item to this_item
set the low_item_index to i
end if
end if
end repeat
set the end of sorted_list to the low_item
set the end of the index_list to the low_item_index
end repeat
return the sorted_list
end ASCII_Sort

Regards
Dan
_______________________________________________
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.

  • Prev by Date: Re: Can't save a script without .scpt extension ?
  • Next by Date: Re: Can't save a script without .scpt extension ?
  • Previous by thread: Re: Subroutine difference in script editor and project builder
  • Next by thread: Why this doesn't work?
  • Index(es):
    • Date
    • Thread