On OS X 10.6.8 how can use a desktop icon to launch a console application program?

176 views Asked by At

I've developed a classical terminal application (like hello world) that is usually launched into a terminal window typing a command like: "iMac:~ alberto$ ./HelloWorld -Lesperanto"

What I like to do is to create on the desktop an icon that, when pressed, opens a terminal window into a specific directory and than into it types a command (in the upper example: "./HelloWorld -Lesperanto")

2

There are 2 answers

0
Pax to You On

I've created into the desktop folder a shell script with the instructions I want to execute. Then I used the chmod +x command to make executable the script. Finally I via Get Info finder function I've set the Terminal application as the program that have to be used to open the file. The only open question is modify the icon that the finder shows on the dektop

0
John O'Neill On

Create an apple script using Script Editor with something similar to the following:

do shell script "./HelloWorld -Lesperanto"

If you then save this as a script you can then place this script on your desktop to be run easily.