Ruby as ApplyScript Replacement?
With the recent developments going on between OS X and Ruby, A lot of Ruby addicts are convinced that Ruby has the potential to be the de-facto OS scripting language of choice within the next few years. A lot of programmers find AppleScript secretive or hideous enough to avoid it wherever possible. There’s an article recently that compares an AppleScript code and it’s ruby alternative:
The AppleScript Code:
tell application “TextEdit”
get paragraph 1 of document “Read Me”
end tell
The Ruby Alternative
app(’TextEdit‘).documents[’Read Me‘].paragraphs[1].get
In reality, AppleScript is much more easier to understand, but the Ruby version is easier to remember in terms of its construction and as long as you’re familiar with Ruby syntax, you won’t get lost.