play-button-itunes-patch icon indicating copy to clipboard operation
play-button-itunes-patch copied to clipboard

Play Button iTunes Patch not working on MacBook Pro Touch Bar w/ Mojave

Open kenmhaggerty opened this issue 5 years ago • 22 comments

I will have to double-check if the patch is working on my 2012 MacBook Pro running Mojave, but on my 2018 MacBook Pro running Mojave, the Touch Bar's play button still launches iTunes even after going through the regular setup process w/o error. (Disable SIP → Run patch → Re-enable SIP)

Please let me know what info I can provide to help debug.

kenmhaggerty avatar Oct 07 '18 19:10 kenmhaggerty

Same here :)

petersg83 avatar Nov 04 '18 18:11 petersg83

Sorry, things seem to have changed recently and I haven't had time to find a workaround. I did notice that Apple has lately released an API to properly handle the keys without launching iTunes, thus mostly eliminating the need for this patch. Is the app that you are using not handling media keys properly? If so, can you share which app this is?

thebitguru avatar Nov 07 '18 02:11 thebitguru

I checked on my iMac with a Bluetooth keyboard and can confirm that the play button doesn't launch iTunes, but my MacBook Pro's touch bar will launch iTunes via the play button even from Finder.

kenmhaggerty avatar Nov 07 '18 03:11 kenmhaggerty

Which media player are you using that doesn't respond to the key in the first place?

thebitguru avatar Nov 07 '18 03:11 thebitguru

I'm a little confused? My understanding is that this patch simply stops iTunes from launching when the play button is pressed and iTunes is not open. I am not using a media player when this happens.

kenmhaggerty avatar Nov 07 '18 03:11 kenmhaggerty

Oh, I see the confusion. In previous macOS versions, Apple would launch iTunes when you used the media keys even if you had a different media player (e.g. Nightingale) running. That was my intented use case for creating this patch.

In your case it sounds like you don't want iTunes to start in any scenario...?

thebitguru avatar Nov 07 '18 04:11 thebitguru

Yes! Sometimes I accidentally tap the play button, and it shouldn't do anything if there's no media player launched. I think that should be the default macOS behavior... but in the absence of that I've been relying on this patch to do that!

kenmhaggerty avatar Nov 07 '18 04:11 kenmhaggerty

Ah, OK. I was thinking of archiving this project now that macOS supports originally intended use case out of the box, but I will take another look hopefully soon and report back here.

thebitguru avatar Nov 08 '18 14:11 thebitguru

Hi, I found the patch for the same reason as kenmhaggerty's. I have to add that I use Spotify and if I haven't done anything with Spotify for a while (while it is open somewhere in my spaces) and I press play to play the music on spotify, many times it launches iTunes. Even though Spotify is open! I don't know if the patch you created fixes this behavior but I'm interested if it does. Also, I would love to never launch iTunes with the play button, and if it's possible, to even choose what to launch with it (Spotify for example). If you know something that does that, I would be really interested too. In any case, thanks for your work :)

petersg83 avatar Nov 10 '18 22:11 petersg83

I am debating creating a simple replacement menu bar app that can monitor the media keys and either ignore them (so iTunes doesn't launch) or letting another app handle it. This would also eliminate the need for patching an OS released file like this project does. But, it would add another app that would have to run all the time. Would such an app be of interest?

thebitguru avatar Nov 19 '18 05:11 thebitguru

For my use it would be perfect, just an icon in the top bar wouldn't bother me :)

petersg83 avatar Nov 24 '18 18:11 petersg83

OK, I will do some research and see if that can be a replacement app. No commitments though :)

thebitguru avatar Nov 25 '18 20:11 thebitguru

Awesome thanks :)

petersg83 avatar Nov 25 '18 20:11 petersg83

I did notice that Apple has lately released an API to properly handle the keys without launching iTunes,

Are there any links for this new API? I've searched Apple's documentation, but couldn't find anything more recent than Snow Leopard. https://developer.apple.com/library/archive/technotes/tn2450/_index.html

benlk avatar Nov 28 '18 18:11 benlk

MPRemoteCommandCenter is what I had in mind.

thebitguru avatar Nov 29 '18 16:11 thebitguru

FYI, BeardedSpice is an option for ignoring media keys. I created a simple "strategy" script for it that can accomplish this. Given BeardedSpice's original use case, the interface isn't ideal (shows the title of the first tab), but it's a proof of concept. This is the strategy gist.

thebitguru avatar Dec 03 '18 02:12 thebitguru

Yes, please, if you have time, create something, anything that'll prevent iTunes from launching when you press the play button, even when there's no other media player open. Of course when iTunes or other media players are open the keys should work. I'm holding off upgrading to Mojave because of this. Thanks a lot.

pleasejust avatar Dec 04 '18 21:12 pleasejust

I have the exact same issue as petersg83 and hoped to find any solution here. Are there any news on this?

kaiserkiwi avatar Jan 28 '19 09:01 kaiserkiwi

I also have the same issue as those above me.

pickanothername avatar Mar 21 '19 07:03 pickanothername

Any update on this?

m1guelpf avatar Apr 07 '19 09:04 m1guelpf

Not a perfect solution but recently discovered https://github.com/tombonez/noTunes.

yougotwill avatar Jan 13 '22 05:01 yougotwill

There's also https://github.com/beardedspice/beardedspice

AlecRust avatar Jan 13 '22 10:01 AlecRust