Automating the command process

Discussion in 'Mac Programming' started by milessthomas, Oct 5, 2007.

  1. milessthomas macrumors newbie

    Joined:
    Oct 2, 2007
    Location:
    obx, nc
    #1
    If any of you could provide me with a site or personal instructions of how to do this, your help would be greatly appreciated.

    What I want to do is, create an icon on the desktop that when clicked will open terminal and automatically send the command "telnet 10.157.183.10"

    Can anyone walk me through the steps on how to do this?

    ::Sidenote::I'm doing this for an employee that doesn't understand this process. He understands once he gets past the telnet prompt. The telnet command telnets to our SunOS server that holds our Parts Store Database on a database I believe is called GPC TAMS.
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    The easiest is to use AppleScript:
    Code:
    tell application "Terminal" to do script "telnet 10.157.183.10"
    In Script Editor, you can save as "application bundle".
     
  3. MongoTheGeek macrumors 68040

    MongoTheGeek

    Joined:
    Sep 13, 2003
    Location:
    Its not so much where you are as when you are.
    #3
    Easiest solution.

    Open terminal
    File Menu->connect to server
    pick telnet
    click the plus sign (on the right)
    enter the IP address when prompted
    pick the newly entered server in the right hand pane
    click connect
    When the window pops up click save as
    have it save only the main window (don't need to enter a command)
    Pick a location to save it.

    Easy enough?

    I have a bunch of these setup with different servers and different settings. Custom back grounds, a different size for machines that want a 132 column output, different colors so I can tell them apart at a glance.
     
  4. milessthomas thread starter macrumors newbie

    Joined:
    Oct 2, 2007
    Location:
    obx, nc
    #4
    Thanks you both very much for your help!

     
  5. HiRez macrumors 603

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #5
    You can also just type in any command directly ("Execute this command") in the save dialog box which will execute in the Terminal window when double-clicked from the desktop.
     
  6. milessthomas thread starter macrumors newbie

    Joined:
    Oct 2, 2007
    Location:
    obx, nc
    #6
    kainjow's response worked the best for me. Seeing as once I used that I figured out how to add additional lines to the applescript to automate the process even further
     

Share This Page