[Haskell] ANN: Foreign.AppleScript version 0.1

Wouter Swierstra wss at Cs.Nott.AC.UK
Mon May 14 03:59:47 EDT 2007


			* Foreign.AppleScript *
			    version 0.1


I'd like to announce the first public release of Foreign.AppleScript,  
a library for compiling and executing AppleScript from Haskell.

AppleScript is a scripting language available on all modern Apple  
computers. It can be used to script most applications on running on  
MacOS X. Using AppleScript you can, for instance:

   * write dirt-cheap GUIs;
   * use Apple's built-in text-to-speech to read out text;
   * play your favourite iTunes tracks;
   * open URLs in your standard webbrowser.

Unfortunately, AppleScript isn't the world's greatest general purpose  
programming language. Using Foreign.AppleScript, however, you can  
pimp your Haskell apps with all neat stuff AppleScript can do.

How to get it?

   Darcs:
     darcs get http://www.cs.nott.ac.uk/~wss/repos/ForeignAppleScript
   Tarball:
     www.cs.nott.ac.uk/~wss/repos/ForeignAppleScript/dist/ 
AppleScript-0.1.tar.gz
   Haddock:
     http://www.cs.nott.ac.uk/~wss/repos/ForeignAppleScript/dist/doc/ 
html/
   Hackage:
     http://hackage.haskell.org/cgi-bin/hackage-scripts/package/ 
AppleScript-0.1

There are a few small examples included with the source files.

Implementation:

At the moment, the binding is very restricted. Essentially, there is  
a function:

 > runAppleScript :: String -> IO ExitCode

That will compile and execute any String of AppleScript you pass it.  
The result is an ExitCode, indicating whether or not the script  
succeeded.

I have some ideas about how to improve this simple interface,  
allowing you to access the result of executing the AppleScript. This  
still needs a bit of work, before I can release it.

It would be pretty interesting to try and write a typed combinator  
library to help generate AppleScript code. If you have any ideas  
about this, please do get in touch. Patches and suggestions are very  
welcome.

Finally, I'd like to thank Duncan Coutts for helping me cabalize the  
code.

Have fun!

   Wouter


This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.



More information about the Haskell mailing list