this is the script I use from this article https://medium.com/trabe/limiting-your-macs-volume-in-2019-f314e20408ab . It works perfectly.
constructor(appName, maxVolume) {
this.app = Application.currentApplication();
this.app.includeStandardAdditions = true;
this.appName = appName;
this.maxVolume = maxVolume;
}
get currentVolume() {
const { outputVolume } = this.app.getVolumeSettings();
return outputVolume;
}
limitVolume() {
if (this.currentVolume > this.maxVolume) {
this.app.beep();
this.app.setVolume(null, { outputVolume: this.maxVolume });
}
}
showNotification() {
this.app.displayNotification("", {
withTitle: this.appName,
subtitle: `Limiting your 🎧 volume to ${
this.maxVolume
}% to protect your ears`
});
}
}
const PurrfectVolume = new Volimiter("Purrfect volume 😸", 00);
PurrfectVolume.showNotification();
function idle() {
PurrfectVolume.limitVolume();
return 0.5;
}
I was just wondering, what should I add in the script to make the volume limit be turned off when I enter some specific apps like Skype for example or Facetime? Is it possible? Thanks