How to Launch an Application When Switching to Mains Power

You can use Power Manager to automatically launch an application when switching from battery to mains power.

Being able to trigger applications, scripts, and tasks when switching from battery to mains power is useful. Imagine plugging your Mac back into the mains power and for the computer to automatically starting backing up and checking for software updates.

We have previously shown how to run a command when switching from mains to battery power. Today we will create an event to perform a task when going the other way, from battery to mains power.

Create a Power Adapter Triggered Application Launch Event

  1. Launch System Preferences and select Power Manager.
  2. Click Add…to create a new event.
    Click Add to begin creating a new Power Manager event
  3. Choose the template Launch an application on mains power.
    Select the Launch an application on mains power task
  4. Click Continue to the Launch step.
  5. Choose the application to launch. You can choose an application to launch, or a document to open.
    Choose the application to launch
  6. Continue through the remaining steps until your event is created.
    Continue passed the Constraints step
    Document your new event in the Why step
    Confirm your new Power Manager event should be created
Power Manager will now launch an application when your Mac switches to mains power

Having followed the above steps, your event is scheduled and ready to perform. Try disconnecting and reconnecting your laptop mains power. A moment after reconnecting, your Mac will automatically launch your choosen application.

This article was posted in , , and and tagged , , , and .

Published by Graham Miln on