Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jun 5, 2013, 07:36 PM   #1
Pecans
macrumors member
 
Join Date: Jul 2012
Simple applescript question

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 Thumbnails
Click image for larger version

Name:	Mail2.jpg
Views:	22
Size:	76.7 KB
ID:	415425  

Last edited by Pecans; Jun 5, 2013 at 07:42 PM.
Pecans is offline   0 Reply With Quote
Old Jun 5, 2013, 11:49 PM   #2
ytk
macrumors regular
 
Join Date: Jul 2010
Code:
tell application "Finder" to open POSIX file "/Applications/Safari.app"
ytk is offline   0 Reply With Quote
Old Jun 6, 2013, 02:58 AM   #3
Pecans
Thread Starter
macrumors member
 
Join Date: Jul 2012
Quote:
Originally Posted by ytk View Post
Code:
tell application "Finder" to open POSIX file "/Applications/Safari.app"
Thanks this worked perfectly!
Pecans is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:22 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC