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.
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
Launch System Preferences and select Power Manager.
Click **Add…**to create a new event.
Choose the template Launch an application on mains power.
Click Continue to the Launch step.
Choose the application to launch. You can choose an application to launch, or a document to open.
Continue through the remaining steps until your event is created.
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.