Article:
 |
|
Replacing AppleScript with Ruby
|
| Subject: |
|
passing requests from applescripts to rb-appscripts |
| Date: |
|
2008-04-08 10:56:02 |
| From: |
|
gauvins
|
|
|
|
Thanks for an excellent post. I've been able to run your example without problem, from the Terminal.
I am unable, however, to figure how an applescript can call an rb-appscript.
Terminal: ruby test2.rb /Users/gauvins/Desktop/test.txt (does work)
AppleScript:
set the_params to “/Users/gauvins/Desktop/test.txt”
do shell script “ruby test2.rb ” & the_params
does not work. Including variants
Any idea?
(I am not a developper at all. Just a poor soul trying to automate a very tedious task :)
|
Showing messages 1 through 2 of 2.
-
passing requests from applescripts to rb-appscripts
2008-04-08 11:21:34
Matt Neuburg |
[View]
-
passing requests from applescripts to rb-appscripts
2008-04-08 16:23:08
gauvins
[View]
I'm not sure why you'd want to do this; the whole point of my article here is that you can just start in Ruby and stay in Ruby, and never use any AppleScript code at all. However, my book explains about calling Perl, Ruby, etc. from AppleScript and vice versa. Here is a simple example.
Ruby file /Users/mattneub/Desktop/test.rb:
AppleScript code:
Here is another example.
Ruby file /Users/mattneub/Desktop/test.rb:
AppleScript code:
That should get you started.