Can Python/Ruby/Perl/etc (or even bash) replace AppleScript? I'm not inviting people to hate on AppleScript in general; I'm just wondering if what makes AppleScript useful can instead be used by other general-purpose scripting languages. I.e., Lion &amp; Mac Apps probably give AppleScript hooks &amp; APIs—could any language use those? Or is AppleScript in its own special category?

Context: I'm learning about Unix and how it underlies OS X, and trying to become aware about opportunities and strategies for automation &amp; abstraction. Aaaand I already feel like my brain is leaking, so if I have to add more to my plate I try to do so sparingly.
In terms of general purpose Unix scripting, many languages like bash, perl, python, or ruby are more capable than AppleScript. But AppleScript has a special role in MacOS with great native support for Mac specific things, particularly related to the GUI.

There are bindings between other scripting language and MacOS events. For instance, see the MacPython OSA Modules°°° or Apple's Ruby and Python for Mac OS X°°°. In general I'd consider these efforts second class citizens; they may work and be a good choice but it will be a bit of an awkward fit.

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
°°° EDIT:
Both languages are not supported on latest MacOS systems. These links return:


  Retired Document – Important: The current version of Ruby (2.0) is not
  supported as a Cocoa scripting language in OS X v10.9. The remainder
  of the content in this document has not been reviewed for accuracy.
  Apple recommends Objective-C for the development of Cocoa apps. [My highlighting.]


Documents are finished with this line: 


  Copyright © 2013 Apple Inc. All Rights Reserved. […] Updated: 2013-09-18