Creating shortcut on desktop and set icon to shortcut

Discussion in 'Mac Programming' started by satyam90, Mar 31, 2009.

  1. satyam90 macrumors regular


    Jul 30, 2007
    Bangalore, India
    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/" 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?
  2. kainjow Moderator emeritus


    Jun 15, 2000
    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.

Share This Page