How to run a terminal command automatically

Discussion in 'Mac Programming' started by JBot, Dec 2, 2007.

  1. JBot macrumors 6502

    Joined:
    Jan 9, 2006
    Location:
    Calgary.Alberta.Canada
    #1
    I have my desktop server sharing my media. I can access it when im not at home by tunneling into it by running: ssh UserName@IPAddress -L 3689:localhost:3689
    Then i broadcast it locally by running Network Beacon.

    ALL besides the fact. I am wondering if i can do all this automatically. I havent used automator much, but i do know you cant just run a terminal command through it. UNLESS someone knows of a plugin that will allow you to do this?
    Ideally i would want to have a workflow like app that will first execute the command, and then open network beacon automatically. does anyone know how this can be done?

    Thank you very much!
     
  2. HiRez macrumors 603

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #2
    Sure you can, use "Run Shell Script" action from the "Automator" group. Just put your command into a shell script text file. You could also execute command-line commands through an AppleScript (even through Automator if you want using "Run AppleScript") if you need something more elaborate.
     

Share This Page