When

  1. The audio output device changes.

If

AND
  1. The audio output device from Audio Output Device Changed contains AirPods

Set Volume and Open Spotify

  1. Set the output volume to 20%
  2. Launch Spotify

If

AND
  1. The audio output device from Audio Output Device Changed contains Speakers

Do

  1. Set the output volume to 30%