On 30 Mar 2014, at 13:09, lopmenhed wrote:
If I simply select "foo.py" in the Item pane and then use the Open
action,
it doesn't work. This is what I'd like to be able to do, and even
better
I'd like to be able to specify arguments for the command.
In general, the Open action is equivalent to double-clicking the file in
Finder or running `open foo.py` from Terminal. So if you can get *that*
to execute the script, Quicksilver should, too.
I wouldn’t screw with the behavior of Open though. There are already
actions that can take care of this. “Run […]” will run the command
and select the results as text in Quicksilver. “Run in Terminal
[…]” will open a new Terminal window and run the command there. I
think that also works if you’re using iTerm. In all cases, you can
optionally type arguments in the third pane.
(Note that passing arguments from the third pane is currently absolutely
broken, but [a fix][1] should be released very shortly.)
#!/Users/kuzzooroo/anaconda/bin/python
import random, os
fname = os.path.expanduser("~/Desktop/test_") +
str(random.randint(0, 65536))
with file(fname, 'a'):
os.utime(fname, None)
The she-bang on this script is correct, I've given myself execute
permissions on it, and it works from the command line.
I tested that script with both `#!/usr/bin/python` and `#!/usr/bin/env
python` using the “Run […]” action and it worked.
If you just want this action to be easier to get to, you could try
dragging “Run […]” up above “Open” in Preferences → Actions.
That should make it appear by default for executables, but since it
doesn’t apply to other files, it shouldn’t interfere with normal
file behavior.
--
Rob McBroom
http://www.skurfer.com/
[1]: https://github.com/quicksilver/Terminal-qsplugin/pull/12
--
You received this message because you are subscribed to the Google Groups
"Quicksilver" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/blacktree-quicksilver.
For more options, visit https://groups.google.com/d/optout.