Simple applescript question

Discussion in 'Mac Programming' started by Pecans, Jun 5, 2013.

  1. Pecans, Jun 5, 2013
    Last edited: Jun 5, 2013

    macrumors member

    Joined:
    Jul 31, 2012
    #1
    So I'm trying to write an applescript to make it so I can restart my Minecraft server via E-Mail (you can make the mail app run an applescript for different criteria. See the attached picture). I have it stopping the server already but I cant figure out how to make it open the start_server.command file to start it again. Here's what I have so far:

    on run
    tell application "Terminal" to activate
    delay 2
    tell application "System Events" to keystroke "stop"
    delay 5
    tell application "System Events" to keystroke return
    end run

    So after keystroking return I need it to open finder and open a certain file. How would I go about doing that? Sorry if this post was hard to understand!
     

    Attached Files:

  2. ytk
    macrumors regular

    Joined:
    Jul 8, 2010
    #2
    Code:
    tell application "Finder" to open POSIX file "/Applications/Safari.app"
     
  3. thread starter macrumors member

    Joined:
    Jul 31, 2012
    #3
    Thanks this worked perfectly!
     

Share This Page