Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let user define app play/pause starts #2

Open
devinrhode2 opened this issue Sep 23, 2013 · 11 comments
Open

Let user define app play/pause starts #2

devinrhode2 opened this issue Sep 23, 2013 · 11 comments

Comments

@devinrhode2
Copy link

I would like to start Spotify instead of iTunes.

@thebitguru
Copy link
Owner

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
Copy link

dsiem commented Mar 24, 2015

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
Copy link

dsiem commented Mar 24, 2015

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

@digerata
Copy link

digerata commented Apr 3, 2015

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

@gabigabogabu
Copy link

@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
Copy link

dsiem commented Apr 21, 2015

For the old python based cli something like

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

should work

@jellyfang
Copy link

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
Copy link

mislav commented Jul 1, 2015

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
Copy link

dsiem commented Jul 2, 2015

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
Copy link

mislav commented Jul 2, 2015

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants