Praful wrote:
I have only one version of Ruby unless ASTranslate is picking up Netbean's jRuby.
It should pick up whatever ruby interpreter is found first on $PATH. Not sure why it isn't working for you. Have you tried it with a different application at all?
To perform a search I'm using
address
book.contacts[its.firstname.eq("Fred")].get(:timeout => 50000).each do |c|....
1. How do I find out what other operators are valid as well as eq in the search? One example has ne (not equal). Are the others gt, lt, gte, lte?! And what about the boolean operators?
Supported operators are listed under the 'by Filter' reference form section in ch.9 of the appscript manual:
http://appscript.sourceforge.net/rb-appscript/doc/appscript-manual/09_referencef orms.html
2. You provided the timeout argument. Is there a way of finding out the arguments? I've seen the help in the doc about introspection (properties, commands, parameters, etc) but can't work out how I would have found out the parameters to the get command.
Default parameters (:wait_reply, :timeout, :result_type, :ignore) are described in ch.11 of the appscript manual, and are available on all commands:
http://appscript.sourceforge.net/rb-appscript/doc/appscript-manual/11_applicatio ncommands.html
To find out what other parameters (if any) a particular application command has, see its dictionary definition. ASDictionary can export application dictionaries in HTML format, or you can look up individual command definitions via appscript's built-in help, e.g. to view the definition for Finder's 'make' command:
app('Finder').help '-t make'
(Note that using appscript's built-in help requires ASDictionary to be installed and its preferences configured.)
3. Related to 2 above: I originally used get.find_all because I saw an example. I thought I'd tried get.each. However, get.each works. How do I find out which commands and properties are available on the get command?
The value returned by the 'get' command will depend on what you called it on. In your case, you called it on a reference to every contact of an address book, so the result will be a list (Array object) containing zero or more references.
To find out what methods are provided by Ruby's Array class, look it up in the Ruby documentation, e.g. see:
http://www.ruby-doc.org