Example of applescript as text; I hope a substantial part of this project could be shared in this way