• 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: the Holy Grail of AppleScript lists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: the Holy Grail of AppleScript lists


  • Subject: Re: the Holy Grail of AppleScript lists
  • From: has <email@hidden>
  • Date: Wed, 19 Mar 2003 22:38:18 +0000

Paul Skinner wrote:

-->list of 8291 items.

Nothing very remarkable in this. Despite what the Standard Additions dictionary might claim, the 'do shell script' command returns Unicode text, not a string. The ~4000-item stack overflow problem only affects the latter type.


Other stuff:

- Re. using the shell to sort: while quicker at sorting strings than a native sort routine, it'll never make a good general-purpose list sort for AppleScript, given that what comes out isn't necessarily what went in. The shell's own sort command's usefulness in sorting text is also limited, given that it reserves the line feed character for its own nefarious purposes and only understands characters in the ASCII 0-127 range anyway. If you attempt to sort text containing any other characters, you'll get bad results - Perl or Python might be a better bet.

- Remember to use 'quoted form of theString' when including it in the shell script. (Every 'do shell script' user should get this reminder tattooed on their hands where they won't keep forgetting it.)

- I fail to see your problem with using Serge's quicksort library just because the code behind it is large and complicated. (I can assure you that the code behind the sort commands in the shell, Python, Perl, etc. is a heck of a lot larger and more complicated than this.) It's not like you have to look at any of it - never mind understand it all - in order to use it. Its interface may not be perfect, but it's well documented and easy enough to use, and it takes just one more line of code to bind it to your script:

property SortLib : load script (alias "path to quicksort library")

...
set sortedList to SortLib's quicksort(myList)

(Perl and Python users, for example, have absolutely no problem with libraries, so - lack of a convenient 'import' command for the terminally lazy notwithstanding - I'm not sure why so many AS users should have such a hangup over the things. Go figure.)

has
--
http://www.barple.pwp.blueyonder.co.uk -- The Little Page of AppleScripts
_______________________________________________
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.

  • Follow-Ups:
    • Re: the Holy Grail of AppleScript lists
      • From: Paul Skinner <email@hidden>
  • Prev by Date: Re: "tell" is opening *classic* QuickTime Player, not OSX version!
  • Next by Date: Re: FileMaker Pro and "field" requests
  • Previous by thread: Re: the Holy Grail of AppleScript lists
  • Next by thread: Re: the Holy Grail of AppleScript lists
  • Index(es):
    • Date
    • Thread