Kawili-wili
Kawili-wili

Reputation: 439

Scheme instead of Applescript?

Can I use Scheme instead of Applescript on the Mac to automate apps such as iTunes, iCal, Mail, etc.?

Upvotes: 2

Views: 386

Answers (3)

brennanyoung
brennanyoung

Reputation: 6524

Silly suggestion(?) but: Douglas Crockford built a scheme interpreter in JavaScript, and you can script the mac (using OSA) using javascript. Could this work?

Upvotes: 0

Jerry Stratton
Jerry Stratton

Reputation: 3466

If it’s just that scheme is awesome, you are probably out of luck. But there are other options. appscript currently supports Ruby, Python, and Objective-C.

Combined with the ASTranslate application also linked on the appscript page, you should be able to do anything using appscript that you can do using AppleScript. I’ve used it to import FileMaker databases into MySQL, both directly and using Django, and also to control iTunes.

If you’re inclined that way, it might be possible to port appscript to scheme.

Upvotes: 1

There is no fundamental reason that you could not build another language to construct the messages (Apple Events) that are passed through the OS to other processes. Back in the days of Classic, the MPW shell had constructs for doing exactly that.

Apple provides Open Scripting Architecture to support this kind of thing.

But...

  • Wikipedia reports that there are Javascript, Perl, Python, Ruby, and Tcl tools that can generate Apple Events with the Javascript OSA component being best integrated and a better MacRuby interface coming.
  • The result might not feel very scheme-like.

Upvotes: 1

Related Questions