1

I want to have a number of items on my desktop which will be used to launch some apps. E.g. launcher for MacVim with specific settings for each project. I don't know how does it name in Mac OS. I was tried to create executable .sh script but it opens Terminal, it is annoying. What is Mac way to do this?

1

AppleScript applet. You can use do shell script to wrap your shell commands in an AppleScript applet that you can double-click.

  • It seems that AppleScript is what I need. Can you help me to fix it? Executing do shell script "open -a MacVim" works, but I want to do more vim stuff at start. The way is to start mvim instead of MacVim.app. I'm trying to do shell script "open /usr/local/bin/mvim --args -c ':cd ~/my/project'". This works fine but opens Termital too. How can I start mvim without Terminal opened? – Anton Egorov Jan 23 '11 at 2:12
  • The solution is do shell script "/usr/local/bin/mvim -c ':cd ~/my/project'" – Anton Egorov Jan 23 '11 at 2:16
  • I have saved this AppleScript as Application. It starts fine, but it it seems that apple script is still running after MacVim was opened. Is it possible to terminate script, but have MacVim running? – Anton Egorov Jan 23 '11 at 2:32
1

I'm not sure I understand what you mean, anyway you can try Automator.

  • Automator does not work for me – Anton Egorov Jan 23 '11 at 2:04
0

Open Automator and create an Application with a single Run Shell Script action:

 open -a MacVim

If you want to pass command-line arguments, invoke like this:

 /Applications/Firefox.app/Contents/MacOS/firefox-bin -ProfileManager &

This application will launch Firefox and quit instantly (because of the trailing &), leaving only Firefox running. You can even pass arguments that way.


Alternatively, create an application using AppleScript Editor with the following AppleScript code:

tell application "MacVim" to activate

This will simply launch the application. If you want to pass command line arguments, do it like this:

do shell script "open -a '/Users/danielbeck/Applications/Firefox.app' --args -ProfileManager"

Both ways (Automator and AppleScript applications) work fine and don't keep either Terminal or a script application running for more than a second or so. Using Automator, you can even create a Service if you choose so.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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