PDA

View Full Version : Creating shortcut on desktop and set icon to shortcut




satyam90
Mar 31, 2009, 05:56 AM
I wrote some perl script to track some process and network parameters statics. The perl script file is in my HOME directory. It will be run using the command "/usr/bin/perl $HOME/perlfile.pl" from terminal.
For running this task, I want to create some shortcut on my desktop and assign some icon to it. So that when user double clicks the icon on my desktop, it must the command and show me the statistics. How to achieve it.
Does any one did this type of task before?



kainjow
Mar 31, 2009, 09:30 AM
One way is to make a new .command file with a text editor, and put in the commands you want executed. When double-clicking, it will open in Terminal and run. You need to set the permissions on it though.

You can just output whatever data you need to show in Terminal, or write an AppleScript to wrap the command and display it in a dialog. This might be a better since you can then save the script as a .app to run.