thebitguru / play-button-itunes-patch

Play Button iTunes Patch
http://www.thebitguru.com/projects/iTunesPatch
Other
644 stars 19 forks source link

Let user define app play/pause starts #2

Open devinrhode2 opened 10 years ago

devinrhode2 commented 10 years ago

I would like to start Spotify instead of iTunes.

thebitguru commented 10 years ago

Thanks for the input. I am not sure if that would be easy to do. The patch basically comments out the iTunes applescript command, and I am not sure if there is enough space for configurability. I will explore this once we figure out the issue with codesign.

dsiem commented 9 years ago

At least for rdio you can simply replace --ll application id \"com.apple.iTunes\" to launch by tell application id \"com.rdio.desktop\" to launch in Patcher.m. The fortunate thing in this case is that both strings have equal length. If the new application id is shorter, you can probably place comment symbols or spaces at the appropriate places. If the new application id is longer, this approach will fail.

dsiem commented 9 years ago

For Spotify you could probably do something like tell application __ \"Spotify\" ________ to launch (The _ are also spaces but placed arbitrarily)

digerata commented 9 years ago

Thanks, @dsiem! Just used your method to have spotify start. Worked great. Thanks @thebitguru for creating this!

gabigabogabu commented 9 years ago

@dsiem Sorry, I'm new to python so please correct me.

What you're saying is I should replace map[found_at:found_at+2] = "--" with map[found_at:found_at+len(string_to_find)] = "tell application \"Spotify\" to launch" in play-button-itunes-patch/old-cli/edit_rcd_bin.py and then run play-button-itunes-patch/old-cli/Patch.command

dsiem commented 9 years ago

For the old python based cli something like

map[found_at:found_at+len(string_to_find)] = 'tell application "Spotify" to launch            '

should work

jellyfangs commented 9 years ago

I'm on OS X 10.10.3 and got this script with the GUI to patch correctly. Works great! Now I'm interested in having the play/pause button just mute and unmute all audio. Any insight?

mislav commented 9 years ago

For Spotify you could probably do something like tell application __ \"Spotify\"

Thanks @dsiem, the approach with spaces works. I was able to tweak the binary so it starts Spotify on remote button press, pauses and resumes music on button press, and skips to next song on button double press. (Going back to previous song doesn't work on button triple press, though.)

However, pausing, resuming, and skipping to next song in Spotify only works if iTunes is running in the background as well. This is bizarre. It's like rcd is still somehow hardcoded to only execute these applescripts if iTunes is detected as running. This is on OS X 10.10.3

dsiem commented 9 years ago

That sounds strange. I have no problem with the functionality of any of the buttons whether the app is in focus or not. But then I'm also using Rdio and not Spotify. Anyway, the patch doesn't change the behaviour of the buttons once the app is running. It only makes rcd launch Rdio/Spotify instead of iTunes when none of these apps is running. I think this is a Spotify issue.

mislav commented 9 years ago

Anyway, the patch doesn't change the behaviour of the buttons once the app is running. It only makes rcd launch Rdio/Spotify instead of iTunes

Well, I made a script that replaces all "com.apple.iTunes" with "Spotify" in the binary, not just the launch script, which affects the embeded scripts to pause/resume/skip track. The end effect is as I described earlier: pause/resume/skip track actually works within Spotify via remote buttons on headset. However, they only work if iTunes is running, although these controls don't actually affect iTunes in any way due to patched rcd.

RobertoMinelli commented 7 years ago

@mislav, do you mind sharing your rcd patched file that works with Spotify?