MacMost Q&A Forum • View All Forum QuestionsAsk a Question

How To I Create a Macro To Kill (or Run) Programs and Toggle My Wifi?

When I need to do a presentation (w/o wifi), I always turn off my WiFi and shut off my VPN and my Dropbox and Google Drive programs to conserve battery power during my presentation. My question: Is there a way to set up a macro so that one click will accomplish all of that (turn off wifi and shut off 3 programs) and is there a way to set up a macro to reverse that process (turn on wifi and run all 3 programs)?

Thanks!

Why? Really it’s just a streamlining question. I currently accomplish all of this manually, but would like to automate it…
—–
Taylor

Comments: One Response to “How To I Create a Macro To Kill (or Run) Programs and Toggle My Wifi?”

    3 years ago

    You can use Automator to do that. There is a Quit Application action in Automator that you can easily add. Add one for each app you want to quit.

    For Wi-Fi you'll need to look up the AppleScript (or JavaScript, or Shell Script) for that, but it is possible.

    I'd do it with a Shell script. So add that action, and then this should turn off Wi-Fi:

    networksetup -setairportpower en0 off

    You'll need to experiment as en0 may not be Wi-Fi for you. Could be en1 or en2, etc. Try it in Terminal first. Use "on" instead of "off" to turn it back on.

    You'll also be able to do these things using the new Shortcuts app this fall with macOS Monterey.

Comments Closed.