The following is for running a ruby script with Bitcoin-Qt in terminal on OS X 10.8.3, not sure if this works on previous systems.I'm pretty sure you have to install Ruby on Rails (
http://createdbypete.com/articles/ruby-on-rails-development-with-mac-os-x-mountain-lion/)
Open a terminal and run the following to set up bitcoin.conf so that Bitcoin-Qt can operate in server mode. This will allow you to send command lines to it:
echo "rpcuser=bitcoinrpc" >> /Users/YOUR USER NAME/Library/Application\ Support/Bitcoin/bitcoin.conf
echo "rpcpassword=random password of your choosing" >> /Users/YOUR USER NAME/Library/Application\ Support/Bitcoin/bitcoin.conf
Then startup Bitcoin-Qt as a server by entering the following into the terminal:
/Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt -server
Once it is up and running, go to the Applications folder and find Bitcoin Qt. Right click on the app and choose "Show Package Contents." Open the "Contents" folder and copy your .rb script into "MacOs" folder. IMPORTANT: Make sure you edit within the .rb script "rpcuser" and "rpcpassword" to reflect the info from your bitcoin.conf file.
Open a new terminal and type:
cd /Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt
once there do:
(assuming the script name is brute.rb)
and you should get to crackin... hope this helps any mac users out there.