Article:
  Replacing AppleScript with Ruby
Subject:   Eudora?
Date:   2007-03-01 05:51:58
From:   angusm
Good article - thank you. And I like the idea of using Ruby rather than AppleScript.


Unfortunately, it seems there's no escaping the "can't get there from here" frustrations of OSA, and errors that come back are rendered even more cryptic.


The first thing I wanted to do was to get the selected text from the first window in Eudora, but even identifying the first window seems impossible.


app('Eudora').windows[1]
app('Eudora').application.windows[1]
app('Eudora').window[1]


They all seem to fail with 'unknown property, element or command', making it hard to decide how to go on.


eudora = app('Eudora')
sub = eudora.messages[1].subject
puts sub


doesn't throw any errors, but it doesn't seem to give back anything useful either.


Has anyone had any success driving Eudora from rb-appscript, or is the underlying AETE too broken to allow it?

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Matt Neuburg photo Eudora?
    2007-03-01 07:35:43  Matt Neuburg | O'Reilly AuthorO'Reilly Blogger [View]

    Pls see my book, which gives lots of examples of Eudora's scripability brokenness. You cannot expect rb-appscript or any scripting milieu to fix this. In AppleScript, you cannot say:

    tell application "Eudora"
    get window 1
    end tell


    Eudora just whines at you when you say that. So you can't say it in Ruby either.

    As for your second example, it would help you to take time to read what I said in the article, or at least the rb-appscript docs. eudora.messages[1].subject is a reference. To evaluate it, use get:

    puts app('Eudora').messages[1].subject.get


    works fine.