Best sources of libraries for AppleScript?

I would like some reccomendations about where to get some good libraries of basic Applescript functions:
list handlers
string conversions
math

Does anyone have any reccomendations?

Some time ago, we had here a section called AppleMods, where we hosted only libraries. Now, while this section is in a process of resurrection, you can find lots of code both in Code Exchange (subforum in this BBS) and ScriptBuilders. For example, you can get here the incredible math libraries by Deivy Petrescu:
http://scriptbuilders.net/cat.php?category_list=33&act=show_cat&cat_id=33
And, if you don’t distribute this URL (currently pointing to the dead section), you can find here the old AppleMods, where you can still grab lots of nice code:
http://applemods.macscripter.net/
And this is a link to a different place, containing libraries made by Has:
http://applemods.sourceforge.net/modBrowser.html

The best ones to get there are Date, List, Math, Number and Types. You should also get the Loader library, since that’s what’s used to import all the others. I can’t recommend any of the AM text handling libraries - they’re written in AS so ultimately they’re constrained by the general naffness of AS’s text handling. A much better choice is TextCommands, which you’ll find on osaxen.com

HTH

Thanks guys,

The libraries on the first link at scriptbuilders seem less developed than the libraries at sourceforge. I couldn’t figure how to get the sourceforge libraries–I was clicking on the second link for each item–the one that shows the file size–and that link is broken. When I clicked on the first link with the library name I got an html page showing the code. I will start copying and pasting ASAP.

I do all my scripting in Script Debugger–who doesn’t–and I have created several libraries of my own for my commonly used handlers. I load those libraries using script debugger’s library feature. This is handy because SD will export a flattened script so I don’t have to use bundles or manually copy libraries before distibuting a script.

How does loading through the loader work? Is this compatible with the SD library loader?

Finally what is going on with the sourceforge applemods? The link has shown under construction for a while. Is there an ETA for when the site will be back to normal operations?

Thomas

That’ll be the manual. Don’t know why the site is broken: you’ll need to contact the AM maintainer (which is not me) to find out what’s up. The ‘file not found’ page gives instructions for locating their email address. If you can’t get an answer in a few days, let me know as I’ve got copies here I can supply.

Different systems: SD’s system is proprietary and works as of the editor itself; AM’s is open and uses a script object to locate and load libraries in known locations, resolving their dependencies as necessary. There shouldn’t be any problem using the two systems in parallel though. And the AM libraries are BSD-licenced, so there’s nothing to stop you restructuring them if you want.

To load libraries at runtime, add a header to your script like this:

property _Loader : run application (get "LoaderServer") -- [1]

----------------------------------------------------------------------
-- DEPENDENCIES

property _Date : missing value
property _List : missing value

on __load__(loader)
		set _Date to loader's loadLib("Date")
		set _List to loader's loadLib("List")
end __load__

----------------------------------------------------------------------

Then stick the following line in your script so that it gets run when your script starts up:

__load__(_Loader's makeLoader())

Alternatively, you can bind the libraries at compile-time using the line:

property _ : __load__(_Loader's makeLoader())

which’ll give you the same ‘all-in-one’ distributable that SD does.

HTH

[1] Note the ‘(get …)’ bit in the first line of the header. If you don’t put this in and LoaderServer isn’t available, AS will get stupid and display a “Where is LoaderServer?” dialog when you run a script, even though it shouldn’t. (LoaderServer is only required for compiling a script.)

I sent a message to the email address from the “error file not found” page about a week ago and no reply yet.

If you can send me an archive of the libraries by emal I will be grateful.
thomas-at-thomaswhitephoto.com

Thanks,
TW