gdi3d / mute-spotify-ads-mac-osx

Mute Mac (osx) computer audio when Spotify plays an AD
https://gdi3d.github.io/mute-spotify-ads-mac-osx/
MIT License
120 stars 17 forks source link

45:51: execution error: The variable volume is not defined #38

Closed MattSchiller closed 1 year ago

MattSchiller commented 1 year ago

As the title suggests, when running the shell script & updating from CLI, I get the following output:

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5672  100  5672    0     0  89126      0 --:--:-- --:--:-- --:--:--  106k
Update finish. 🥳
45:51: execution error: The variable volume is not defined. (-2753)

I'm inclined to think it's something on my end, but figured I'd reach out and see if this was something you were aware of.

For reference:

Happy to provide whatever additional information you'd like 🙇‍♂️

gdi3d commented 1 year ago

Hi, I'll check the code to see if I can reproduce the error and fix it.

What happens when you run the script manually after being updated?

gdi3d commented 1 year ago

Closing the ticket due to inactivity and not being able to reproduce the error.

MattSchiller commented 1 year ago

Apologies for not circling back sooner (got lost in the shuffle). The issue is still there: muteSpotify

I hope that helps @gdi3d because I really do love this utility (and hate spotify ads lol)

gdi3d commented 1 year ago

Hey!, its quite strange to be honest. Because there's no variable named volume.

The only place where the volume keyword is present is when osascript is called.

Try the following:

MattSchiller commented 1 year ago

The only place where the volume keyword is present is when osascript is called. Try the following:

  • run osascript -e 'tell application "Spotify" to set A to sound volume' with spotify closed (should return 0) This does return 0

  • run osascript -e 'tell application "Spotify" to set A to sound volume' with spotify open (should return the volumen set in the app 0/100) This does return 58 (presumably since my volume is at about halfway)

And I swear to you, as a Senior Dev at a respected company, I am not incompetent. But running these scripts, and then I thought, hey, let me try running the ads-muter program again. And it just worked.

My guess, knowing absolutely nothing of what you've written, is that I got my Spotify or terminal into a weird state mid-some-script. And these commands shook something loose and reset some state.

Or maybe I'm totally wrong. Regardless, I'm happy because this worked and you fixed my issue. THANK YOU <3

gdi3d commented 1 year ago

That's good news!. I'm glad it works ok now! Let's hope it was just a glitch

sajjad5221 commented 8 months ago

Hey! I got this error in mac Ventura. I closed Spotify and run it first before Spotify, then it worked!

gdi3d commented 7 months ago

Thanks for the report!