• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Rebooting a Mac with a Mail Rule
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rebooting a Mac with a Mail Rule


  • Subject: Rebooting a Mac with a Mail Rule
  • From: debt <email@hidden>
  • Date: Wed, 15 Mar 2017 08:44:04 -0700

I’ve written an AppleScript to restart a remote MacBook Pro using 

do shell script "shutdown -r now” ...

It works fine on it’s own, but I want to use it in a Mail rule so I can reboot the Mac remotely by sending it an email.  That’s where the problems start.

When the email comes in, the Mac reboots like it should.  But then when Mail reopens, it checks for mail again and then reboots again.  Now it’s in some kind of endless loop, and if I don’t disable the Mail rule, it will just keep rebooting.

This is on an older MacBook Pro running 10.6.8.  The rule also marks the message as read and moves it to the trash.

It “appears” that the email isn’t fully received before the reboot is triggered.  After the reboot happens a couple of times, and I disable the rule, then that email comes in completely.

Does anyone know what I need to do to get this to work?  I know about setting up a schedule with cron or launchd, but I’d also like to get this to work, as well.

Thanks,
Marc
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Rebooting a Mac with a Mail Rule
      • From: Tom Robinson <email@hidden>
    • Re: Rebooting a Mac with a Mail Rule
      • From: "Stockly, Ed" <email@hidden>
  • Prev by Date: Re: notes to pdf
  • Next by Date: Re: Rebooting a Mac with a Mail Rule
  • Previous by thread: Re: mdfind – How to Find a Specific Word?
  • Next by thread: Re: Rebooting a Mac with a Mail Rule
  • Index(es):
    • Date
    • Thread