How to associate the ".exe" extension to be opened with Mono?
I want to asssociate the .exe
file extension to Mono (don't care about wine).
Apparently, when using Finder's GUI, only .app
files (application bundles) can be selected. But the Mono executable (/Libraries/Frameworks/Mono.Framework/Current/bin/mono) is no such bundle.
I tried some AppleScript
on run this_file
do shell script "mono this_file &"
end run
but Finder's GUI still doesn't allow to associate that with .exe
's.
How to associate a specific file extension to a command-line application in Mac OS X?
Using Automator to save the following as an Application works fine for me, also for new files:
- Start Automator
- In "Choose a template for your workflow" choose "Application"
- Drag the action "Run Shell Script" into the workflow in the pane at the right
- Change "Pass input" from "to stdin" into "as arguments"
-
Replace
echo "$f"
withmono "$f" &
. So:for f in "$@" do mono "$f" & done
- Save (as an Application)
- Use Finder to associate any file extension with this new application (like: hit Cmd-I, or right-click » Get Info, select the application and then choose "Change all")
I have not tested step 5 with mono
, but with the following, which also uses the command line though:
for f in "$@" do open -a /Applications/TextEdit.app/ "$f" done
(I am not an AppleScript expert.)