From: Karl von Laudermann Date: 2008-02-18T23:00:00+09:00 Subject: Re: Send keystrokes to Firefox or Safari? On Feb 17, 7:41 pm, Stedwick wrote: > Well, how about this: is there something like AutoIt for the Mac (if I > can control it with Ruby, so much the better)? > > I tried rb-appscript already, but I couldn't figure out how to send > keystrokes =P There's also rubyosa as an alternative to rb-appscript. (But I have not used it and couldn't tell you anything about it.) Another option is to use JRuby, so you have access to Java's API library, and then use Java's Robot class to send keystrokes. (http:// java.sun.com/j2se/1.5.0/docs/api/java/awt/Robot.html) Unlike with Applescript, there's no way to send events to a specific app; you just have to make sure that Safari is the active app at the time your script "types" the keys.