Run apple script on wake up?

Discussion in 'OS X El Capitan (10.11)' started by SDAVE, Jun 3, 2016.

  1. SDAVE macrumors 68040

    SDAVE

    Joined:
    Jun 16, 2007
    Location:
    Nowhere
    #1
    Hi there
    I have an Apple script that mounts my SMB server and mounts a TimeMachine DMG in the Login Items.

    But when the Mac goes to sleep and wakes up it doesn't remount the SMB, so I was thinking if it's possible to do this?
     
  2. Shirasaki macrumors 603

    Shirasaki

    Joined:
    May 16, 2015
    #2
    Login and wake from sleep seems to be two different things.
    Don't know much about Apple script. Maybe you can create a script to monitor the state of SMB connection. And immediately reconnect once connection is lost.

    My experience is, I can stack very high system uptime using sleep, when not using computer, but not entirely log out. Kinda hard to explain but you may get the idea.
     
  3. SDAVE thread starter macrumors 68040

    SDAVE

    Joined:
    Jun 16, 2007
    Location:
    Nowhere
    #3
    Thanks for the reply. I use a MacBook Pro and need to be logged back into my SMB and the TimeMachine image remounted when the laptop comes back from sleep.

    The TimeMachine issue is more secondary since I'm using a workaround and don't have Time Capsule, but for now put a shortcut to my Apple Script so I just run it when I come back from sleep.
     
  4. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #4
    http://www.controlplaneapp.com

    You could setup Control Plane to run your AS upon wake from sleep.
     

Share This Page