Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I use Leo for structured editing of my code, and Leo has the extension of .leo.

In order to run Leo, I use the following alias

alias leo='arch -x86_64 /usr/bin/python2.6 /Users/bin/Leo-4.7.1-final/launchLeo.py --gui=qt'

It works well to launch leo with leo file as follows.

leo -f hello.leo

However, I need to find a way to launch Leo by clicking the leo file in the Finder/Path Finder.

What might be the solution to this problem?

ADDED

Mankoff's advice on using Automator works. For running PyQt with -f option, I set "Pass input : as argument", and have the following bash code, which launches with/without -f option depending a file is dragged on or not.

if [ -z $1 ]
then
  arch -x86_64 /usr/bin/python2.6 /Users/smcho/smcho/bin/Leo-4.8-b1/launchLeo.py --gui=qt 
else
  arch -x86_64 /usr/bin/python2.6 /Users/smcho/smcho/bin/Leo-4.8-b1/launchLeo.py --gui=qt -f $1
fi
share|improve this question

2 Answers 2

up vote 3 down vote accepted

I would use Automator. Make an app that takes an argument (file dropped on it, file double-clicked associated with that app, whatever), and runs the command you have above.

share|improve this answer
  • Right click on a .leo file and select Get Info
  • On the [whatever.leo] info pane that opens, use the Open With drop-down to browse to the Leo editor.
  • Click the Change All... button

Double clicking any .leo file should invoke the Leo editor from now on.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.