The Perl 5 module Mac::AppleScript is a simple interface to the OSA scripting stuff.