Featured Article: Podcast - Apple Weekly Report #135: Apple Lawsuits, Banned iPhone Ad, Green MacBook Ad
Ruby as a Replacement for AppleScript
by , 3:25 PM EDT, March 20th, 2008
John Muchow has written a series of tutorials on how to replace AppleScript with Ruby. Some developer community members have chimed in, endorsing the general migration. The question was raised as to whether Apple may be grooming Ruby as an eventual AppleScript replacement.
In retrospect, CamelBones, the Perl-Cocoa bridge wasn't quite ready when Leopard was in final Beta, so it wasn't included. However, the package can still be installed from the CamelBones Website. Leopard does include the Python-Cocoa bridge, and Python is not significantly different than Perl as a pure scripting language. However, Ruby is a more modern scripting language that, in addition, is object oriented by design rather than having it added on -- and it's becomming very popular.
At RubyInside, Peter Cooper wrote, "With all of the developments going on between OS X and Ruby lately, I’m becoming convinced that Ruby could become the de-facto OS X scripting language of choice within the next few years. I’m a programmer, but I find AppleScript hideous enough to avoid it wherever possible, and I’m not the only one."
The recent discussions have drawn the attention of MacResearch.org where it was agreed that a good case is being made for making Ruby the favored scripting language in Mac OS X. While Perl and Python enthusiasts likely won't agree, the perceived enthusiasm for Ruby by Apple by the developer community suggests that, as always, Apple will drive the Mac OS X scripting technology in directions it favors.
Observer Comments
QuotePython is not significantly different than Perl as a pure scripting language. However, Ruby is a modern scripting language that is object oriented by design.
Are you trying to start a flamewar, man?!
I'm familiar with both Python and Perl, and to me, they are VERY different. I really don't know what you mean by "pure scripting language", so I can't comment on that. All can say is Python is perfectly modern and object-oriented. I consider it more like Ruby than Perl, to be honest.
It's worth noting that Apple has included a Cocoa-Python bridge in Leopard, along with Cocoa-Ruby. They seem open to both languages.
Also, anyone who wants to use Python or Ruby instead of AppleScript should check out AppScript, available for Mac OS 10.3 and up.
I don't think Apple needs to replace the AppleScript language, but they certainly need to update it. AppleScript desperately needs good text manipulattion functions. Even doing a simple find-and-replace in AppleScript is a chore, and you can forget about regular expressions without an external library.
Overall, it might be simpler to just use Ruby or Python, but I think it would be a shame to lose the plain-English style of AppleScript.
Thu Mar 20, 2008 4:21 pm Subject: Perl/Python
I have been programming in Perl for 16 years. I am also familiar with Python. Each language has its strengths, weaknesses and proponents, but in my opinion they are fundamentally similar. Ruby is object-oriented from the get-go. By "pure," I meant that conventional scripting, in the sense of Bash or T-shell, in both Perl and Python seldom needs to be object-oriented.
-JM
There is ONE really good reason why AppleScript will not / should not be abandoned. It is (mostly) able to be recognised from spoken source code! Try that with just about any other language. My head spins thinking about how you would say some of the text in many programs!
This is the future of communication with computers we are considering here!
Recent Headlines - Updated Saturday, November 29th, 2008
- Sat., 9:00 PM
- Podcast - Apple Weekly Report #135: Apple Lawsuits, Banned iPhone Ad, Green MacBook Ad
- Fri., 12:45 PM
- Podcast - Mac Geek Gab #178: Batch Permission Changes, Encrypting Follow-up, Re-Enabling AirPort, and GigE speeds
- Thu., 1:30 PM
- iPO Review - Scosche kickBACK iPhone case
- 7:00 AM
- Happy Thanksgiving from TMO!
- Wed., 6:00 PM
- TMO Appearances - Nancy Gravley Joins MacJury Gift Guide
- 5:15 PM
- TMO Visits The Bay, a Premium Apple Reseller in New Zealand
- 3:25 PM
- iPO Oh the Games You'll Play - iPhone: The Wii of Handheld Gaming Devices?
- 2:15 PM
- Sonnet Releases Simply Fast FireWire 800 to 400 Adapter
- 1:10 PM
- Mac Gaming News - Disney Plans 1st Annual PotC Online Thanksgiving Event
- 12:05 PM
- iPodObserver - UK Shuts Down iPhone 3G Ad
- 11:15 AM
- TMO Appearances - Jeff Gamet on MacJury Gift Guide
- 10:30 AM
- TMO Contest - TMO Announces Macworld Expo Pass Winners
- 9:50 AM
- PhotoCopy 1.1 Adds iPhoto Event Support
- 9:15 AM
- Acclivity Buys MYOB US
- 8:30 AM
- Review - Bento 2 Holiday Pack
- 7:50 AM
- Microsoft Offers Black Friday Office Discount
- 7:30 AM
- iPO Quick Tip - iPhone: Google Street View
The Mac Observer Reader Specials
- Download Typestyler, still the Ultimate Styling Tool for Internet, Print and Video Graphics. Works great in Classic with a Native OS X Version on the way. Free Tryout: www.typestyler.com
New iMac 800Mhz Memory 4GB $54. New MacBook & MacBook Pro DDR3 PC8500 4GB Kit $116. MacBook/MacBook Pro / MacMini / iMac Intel Core2 DUO DDR2 667Mhz 4GB Kit $58, 3GB Kit $44, 2GB Kit $30. Click to Maximize your Macs...
Mac observers can now play Party Poker for Mac as well as Mac casino games by going to MacPokerOnline.com.
RamJet Memory: Mac Pro FB-DIMMs: 2Gig kit $95, 4Gig Kit $179, 8Gig Kit $355! MacBook 2Gig Kit $78, 4Gig Kit $149! Click hereFor the latest Apple products use Ciao a comparison website to find laptops like MacBook Air. Then find the best prices on MP3 players and use our comparison tool to evaluate cell phones.
Laptop Hardware Provided by TechRestore - Overnight Mac & iPod Repairs.

