Mac Help Forums


Reply
Thread Tools Display Modes

Restart Action

 
Ric Ric is offline
Senior Member
Ric's Avatar
Join Date: May 2004
Posts: 4,260
 
      7th November 2005
Xcode 2.1 normal AppleScript template...

This was just for fun, put this at the end of your workflow and your Mac will Restart once it has completed it's tasks...

...it will not "force" Restart, any unsaved documents will need to be saved, otherwise the restart will wait for user response.
Attached Files
File Type: zip Restart_Action_Version_1.0.dmg.zip (159.7 KB, 3848 views)
 
Reply With Quote
 
 
 
 
Ric Ric is offline
Senior Member
Ric's Avatar
Join Date: May 2004
Posts: 4,260
 
      9th November 2005
If any one would like a "forced" Restart let me know and I'll have a go at writing one...

...sometimes you want to tell your Mac to Restart without anything stopping it !

regards

Ric
 
Reply With Quote
 
New Member
Join Date: Nov 2005
Location: New Orleans, LA
Posts: 1
 
      24th November 2005
Were I to use this in combination with an apple script and the Mail program in order to request a restart using an emailed cell phone text message,

is there a way to automate the login procedure, too? I know this can be done from the accounts management preference pane, but I don't want it to be that universal. That is, I'd like the computer to restart and automatically log in to a particular account only when the restart request comes from the phone or (actually) the automation itself.

Is this possible?

Yours,
Richard
 
Reply With Quote
 
Ric Ric is offline
Senior Member
Ric's Avatar
Join Date: May 2004
Posts: 4,260
 
      24th November 2005
Hi Richard,

If for one minute I 'ignore' the first part of your question...

It is relatively straightforward to Automate your Mac from remote emails...

To start we can just add in a Rule into 'Mail.app' that will run an AppleScript when it gets a 'certain' email...

Go to Mail-->Preferences--> Rules




As you can see I have put in a few sample Rules...

Now you need to click on the add rule and then name it and navigate to the AppleScript that you want it to run...it must be an AppleScript !






As you can see from the pics above, you need to think about what will trigger the AppleScript...you don't want a piece of Spam setting of your Shutdown--Restart etc workflows...


If you had done an elabourate workflow in Automator, then just save that as an Application, and use this as an the AppleScript, (replacing the name),

Code:
tell application "myWorkflowApp"
activate
end tell
You can replace the myWorkflowApp with any Application on your Mac.

For all of this to work, Mail App must be running, and the User logged in, set Mail to check for new mail every 5 minutes.

Then where ever you are you can send an Email with your 'code words' in to get you Mac to do something...

So on one of my Mac's at home I have a Rule set up that does this...

On receipt of the 'special email', this rule kicks in..

1) Reply to message-with the text "Instructions received Restart in Progress"

This sends me an email message telling me that the remote Mac has got the email and is running the Script.

2) Run AppleScript-this has a delay at the beginning to ensure that the 'message' above gets sent !

Code:
delay 60
tell Application "System Events"
restart
end tell
So that all works fine !

Now back to the first part of your question...

If you log out then all your Apps quit !

So one way, if there are other "Users" on that Computer, you need to enable Fast User Switching and 'switch' to another user before leaving...this will keep Mail open in your 'real user account', checking for any Mail you send, when Mail receives this email it will go off and run your Script...depending on what you want it to do it may or may work. A restart command sent to the User in the background will not restart the Mac, (this may be possible via a shell script) it would have to be sent to the 'Front most' active user, if you see what I mean !

...if you are telling your Mac to restart, then depending on what options you have set in the Accounts Pref Pane will determine who (which User) gets logged back in after the restart !

Another way would be to enable FileVault. If you have stuff on your Computer that you don't want colleagues, siblings etc to see then you can always use FileVault to protect your data. I'm not a big fan of FileVault cause it can tend to break other things...

The only other alternative is to enable SSH on your Mac, this will enable you to login to your Mac remotely and do what ever you want, as long as the Mac is turned on, it doesn't need to be logged in !

But to do this you would need a computer or a PDA that has Internet access to send the commands to the Mac, you would also need to know the IP address of that Mac !

And you would also have to allow SSH 'in' on your Firewall or/and Router...

Maybe you could create another 'User' on that machine that you would login to when leaving your home/office thus protecting your 'real' account, this 'fake' account could then be set to 'listen' for your remote commands...you could set up a free email account just for that user...

All depends on how much you 'don't want' someone else accessing your Mac ?

regards

Ric
 
Reply With Quote
 
 
 
Reply

Thread Tools
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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sleep Action. aaabha Automator 0 28th August 2010 12:52 PM
Introducing Action(s) app.jbbres.com Mac Applications 0 27th June 2010 12:57 AM
folder action Ptarmigan AppleScript 3 6th April 2010 10:09 PM
iPhone is “where the action is” Newsbot Apple News 0 21st January 2009 06:13 PM
Mouse speed changing from restart to restart Benny UK Macs 3 6th October 2005 10:56 AM


All times are GMT +1. The time now is 10:43 AM.
Mac-Help.com is an independent website and is not affiliated with Apple Inc.


Welcome!
Welcome to the Mac Help Forums
 


Latest Threads
New book about Steve Jobs << take part in it!
Arjan (1 Hour Ago, 09:37 AM)

Help! Stupid computer is automatically logging me out
Elizaboo (12 Hours Ago, 10:41 PM)

URGENT Help. Crazy talk Mac!
Joeker (13 Hours Ago, 09:42 PM)

PDF Document
yura (22 Hours Ago, 12:13 PM)

Difficulties with internet speed (nothing to do with connection)
sammethh (1 Day Ago, 06:36 AM)

 


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51