Launch ruby script from Quicksilver

A

Adam Walters

Hello,

I was wondering if anybody knew how to launch a ruby script from
quicksilver? Ideally, i would like to enter text mode of quicksilver,
enter some text to be passed as an argument and run the ruby script w/
that argument. However, it seems like the scripts are not running,
passing arguments aside

I created a script test.rb in ~/Library/Application
Support/Quicksilver/Actions and have tried calling it from Quicksilver
but it does not seem to run. If i run:

ruby test.rb

everything works fine. If i bring up quicksilver, and launch test.rb,
nothing happens

Anybody have any suggestions?

Thanks
 
D

David Rio

[Note: parts of this message were removed to make it a legal post.]

Hello,

I was wondering if anybody knew how to launch a ruby script from
quicksilver? Ideally, i would like to enter text mode of quicksilver,
enter some text to be passed as an argument and run the ruby script w/
that argument. However, it seems like the scripts are not running,
passing arguments aside

I created a script test.rb in ~/Library/Application
Support/Quicksilver/Actions and have tried calling it from Quicksilver
but it does not seem to run. If i run:

ruby test.rb

everything works fine. If i bring up quicksilver, and launch test.rb,
nothing happens

Anybody have any suggestions?


Have you checked if you get any error in the console? Also, does it work
with regular shell scripts?
 
M

Mikael Høilund

I created a script test.rb in ~/Library/Application
Support/Quicksilver/Actions and have tried calling it from Quicksilver
but it does not seem to run.

Put the text `#!/usr/bin/env ruby` in the file as the first line, give
it execute permissions (`chmod +x test.rb` from the terminal), and
restart Quicksilver. Works for me.

I haven't tested this thoroughly, so some steps might be superfluous,
but it definitely works.

--
instance_variable_set(%@\@%sample@%%@[email protected], Class.new(&proc{def
self.net;$;,
$/='','/';%;.fqn-
cmtkhng;end}));Kernel.send:)"define_method",:method_missing){|
n,$_|$_<<"?kd!jhl";n=split.map{|q|q.succ}*'';puts n.reverse.chomp.tr(*
%w{" a})}
(e-mail address removed)
 
A

Adam Walters

If i try executing the command from the terminal i get the following:

-bash: require: command not found

This happens with or without '#! /usr/bin/env ruby' as the first line

The firs tline of my script, asside from #! /usr/bin/env ruby, is
"require 'rubygems'".

Any thoughts why this is failing.

Thanks for the help,
Adam
 
M

Mikael Høilund

If i try executing the command from the terminal i get the following:

-bash: require: command not found


Sorry, my silly mistake. It wasn't actually working.

I've definitely gotten it to work now by putting the direct path to =20
Ruby in the shebang line, instead of env. It works without setting any =20=

execute permissions. My file looks like this:

--8<----
#!/usr/bin/ruby

system "touch ~/Desktop/works_#{rand(65535)}"
--8<----

Modify /usr/bin/ruby if that's not your Ruby's path. Make sure there =20
are no spaces in the first line at all.

Now I've gotta delete a bunch of empty files from my desktop :<

--=20
Name =3D "Mikael H=F8ilund"; Email =3D Name.gsub %r/\s/,%#=3D?,#
*a=3De=3D?=3D,!????,:??,?,,Email.downcase![eval(%["\\%o\\%o"]%
[?**2+?o,?\\*2])]=3D"o";Email.gsub! %%\%c%*3%a, %?%c? % ?@
def The(s)%%\%s.%%s+%.org\n.end; :Go and print The Email
 
A

Adam Walters

Nice, that worked. I think i just needed to specifically set my ruby
path. thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top