Archive for the “Ruby” category

Using a String as a File in Ruby

by john on June 3, 2008

The ability to treat a string as a file can often be quite handy. Generally this most useful when classes/methods expect a file object as an input type. With Ruby, you can use the StringIO library to use a string (…)

Read the rest of this entry »

Using a Stack with Ruby

by john on June 2, 2008

Although an array within Ruby supports all the operations you need for working with a stack (push, pop, etc), the problem is, Ruby does not offer a “formal” stack object and therefore the flexibility of the Ruby array can present (…)

Read the rest of this entry »

Ruby as AppleScript Alternative – Part 6

by john on March 25, 2008

In this post I’ll show how to use the interactive help system within rb-appscript to explore the scripting interface for an application. To begin, you’ll need to verify that you have installed ASDictionary version 0.9.0 or later. You can download (…)

Read the rest of this entry »

Ruby as AppleScript Alternative – Part 5

by john on March 24, 2008

In the previous posts on rb-appscript I dug into some code to show how you can use Ruby and rb-appscript to accomplish the same tasks available with AppleScript. Let’s take a few steps back to look closer at some of (…)

Read the rest of this entry »

Ruby irb Command History

by john on March 17, 2008

If you spend any amount of time working with Ruby in the interactive shell (irb), what follows is a handy script for adding command completion support as well as command history across irb sessions.

Ruby, an AppleScript Alternative – Part 4

by john on March 14, 2008

The fourth in a series of posts on how to use Ruby (rb-appscript) as a replacement for AppleScript.

Ruby, an AppleScript Alternative – Part 3

by john on March 13, 2008

This post is 3rd in a series about using Ruby and rb-appscript as an alternative to AppleScript.

Ruby, an AppleScript Alternative – Part 2

by john on March 13, 2008

This is Part 2 in a series on Ruby as an alternative to AppleScript. Introduced are dictionaries and Scripting Additions.

Ruby, an AppleScript Alternative – Part 1

by john on March 12, 2008

An introduction and installation guide for rb-appscript to enable Ruby developers to query and control scriptable applications on a Mac, providing an alternative to AppleScript.