Automate vpn when opening YouTube

So on my iPhone and iPad I have a shortcut and automation set to when I open the YouTube app to turn on my vpn, then when it closes to turn off the vpn.

Thought this wasn’t possible on a Mac because theres no automations, but then I thought could I not use automator with or without shortcuts?

I’ve never used automator and I should probably learn more about it!

What does everyone think?

Automator is on life support. You can do many of the same things with Shortcuts. Shortcuts does lack automation triggers, but the Shortery lets you trigger automations based on a variety of triggers. Many of the triggers require the paid version, but triggering on Application launch & quit are in the free version.

You’ll probably have to create a Safari Web App in order to trigger the VPN on when you use YouTube and turn it off when you close the window.

There’s a paid version of shortcuts?

I’ve already created a Safari web app for YouTube, it’s in my dock. How would I get the web app to trigger the vpn?

Sorry realised you said shortery, what’s that then?