How would I go about making a stand alone app on my dock to open a game using a terminal command?

I have a game that they never released for mac, and I installed the game using WINE, the install itself was flawless, but every time I want to play it, I'm forced to open Terminal and run

cd /Users/Max/.wine/drive_c/Program\ Files/Electronic\ Arts/Dead\ Space/
wine Dead\ Space.exe

I saw a question that I thought would answer this using applescript, but when i tried to duplicate the example, it didn't work. I'm sure the information I've given is enough to start the answer to my problem, if not, just let me know. Thanks


Solution 1:

create the following plain text file:

#!/bin/bash
cd /Users/Max/.wine/drive_c/Program\ Files/Electronic\ Arts/Dead\ Space/
exec wine Dead\ Space.exe

save it as dead_space.command

in Terminal, change it to an executabe:

sudo chmod +rx dead_space.command

Now, the file dead_space.command should start your game when you double click on it.

Solution 2:

This is perhaps "heavier" than Vincent's solution, but you can create a new Automator document and set type as Application.

In the Actions, search for "shell" and drag "Run Shell Script" over to the workflow on the right. Then just enter your commands. Save it and it will be an OS X application that you can put on your Dock like any other.

This might be easier to edit later, and it's good to be familiar with Automator and what it can do :D

Automator document