Running this sort of thing is probably better done using TeXShop's "engines" instead of calling an applescript from the Macro Editor.
If you look in your ~/Library/TeXShop/Engines folder (especially the Inactive folder) you can see various examples of such engines. The engine files themselves are just shell scripts (so they need to have the executable bit set) Once you've got the script working you can put it in the Engines folder and it will appear in the pulldown menu beside the Typeset button on any document window.
It's very possible that the script you want to run already exists (you mention glossaries). Have your looked at the LaTeXmk engine for TeXShop?
The LaTeXmk script (various versions are found in the Inactive folder; just drag them to the Engines folder and restart TeXShop to activate them.) runs all of the required numbers of latex/bibtex/mkindex/makeglossaries etc. so that everything in your document is complete. It knows about most of the major packages' extra .aux-type files, and is quite smart. The LaTeXmk engine is maintained by Herb Schulz and the latest version can be obtained from his web page.
One thing to watch out for when running scripts from within an application is that the path and environment variables set inside the application are not identical to the path and environment variables you may have set in you bash .profile or csh .cshrc file.
cdat the beginning does work as expected. Adding% !TEX TS-program = glossaryto each entry/file, whereglossary.engineis the new engine, makes the process even quicker. One problem though: how can I tell the engine to open the generatedpdffile after the process is over? – Dror Feb 02 '11 at 07:58open -a TeXShop glossaries.texat then end of the script, which should open both the source and pdf. (If you just want the pdf then open the .pdf version of the filename.) – Alan Munn Feb 02 '11 at 14:31