Kashi: Show Current Song Lyrics on Touch Bar (Spotify / iTunes / Youtube)

I tried with the new JSON and got Error/Nothing was returned.

I'm running Catalina and installed python3 via homebrew.

My launch path for python3 is /usr/local/bin (determined via running which python3) and my site packages path is /usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages which I entered in the second params line. (I followed the directions here: https://stackoverflow.com/questions/122327/how-do-i-find-the-location-of-my-python-site-packages-directory)

I'm trying with Apple Music. I open Music, start a song then use Run Script Now in the BTT config pane.

Any suggestions on different approaches I can try? Happy to add any debug lines into the python script to help resolve

thanks

@happyuturn
To be honest, haven't been testing with Music and wonder if it is app-specific.
Can you confirm the output for Spotify?

I'm a bit confused -- in the readme, it says to import the json file into btt... what does that mean specifically? i couldn't find any import button for json files, just licenses and presets.

Also, in the "Script:" part of the shell script/task trigger, do we paste the contents of the json file? Or of the .py file?

@bttstuff

Sorry if the language was confusing.

BetterTouchTool allows you to import widgets by pasting in the parameters/properties in JSON format.

So by "import", it means to just copy and paste the contents of the Kashi JSON (Select All, Copy). If it doesn't show up when you paste, make sure you have focus on the trigger column pane by clicking it first.

Got it! It imported properly :slight_smile: but now having an error:

Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'requests'

I think this may be due to python3.8 installing instead of 3.7, could that be it? I don't think I have 3.7 installed.

Based on the new instructions for step 4 in the readme, i changed the 3 paths in BTT to be the following:

Launch Path: Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8

Parameters: -c

Library/Frameworks/Python.Framework/Versions/3.8/lib/Python3.8/site-packages

Any ideas for what to do here? Thanks!

@bttstuff

The ModuleNotFoundError means you haven't installed the required modules.

You'll need to make sure the following Python package are installed: OsaScript, Requests, BeautifulSoup

To install a Python package, just type the following in your terminal. Then check the "site-packages" folder and you should be able to confirm that the package folder is there.

pip install requests

OR

pip3 install requests
(for Python 3)

Got it! Seems like those finally installed properly.

I'm now getting another error though:

Traceback (most recent call last):
File "", line 117, in
File "", line 14, in main
IndexError: list index out of range

Any ideas? This is while trying to play a song on the Music.app that's downloaded locally to my computer

Hi there,

I'm not very familiar with coding or python. I installed all three packages and it all seems to be good until Step 4: Set Widget Parameters. I have Launch Path set as "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7",

parameters as "-c"

and environmental variables as "/Library/Frameworks/Python.Framework/Versions/3.7/lib/Python3.7/site-packages".

Right now, the touch bar says "File"",line 212, in "

I don't really know what " The Launch Path parameter must direct to your Python 3 install. " means, and same with "Path will also work"

Can you help me? Thanks!

It's saying

Traceback (most recent call last):
File "", line 212, in
File "", line 19, in main
File "", line 133, in processPlayerData
IndexError: list index out of range

in the return

SAME here. Have you found any ways to make it work?

@bttstuff, @henry_qiu, @iamtaolong:

Sorry for the slow response.

Are you using Music or Spotify? I experienced the same error as you when I used Music. However, after giving the permissions in "Automation", I was able to resolve the issue:

Hope that works for you. If not, I'm happy to continue investigating with you.
If possible, a screenshot of your config would help. Thanks!

My result is "Error/Nothing was returned". Can someone help? Thank you in advance.

i got this error

Traceback (most recent call last):
File "", line 19, in
NameError: name 'false' is not defined

Hi,
it's not letting me install these:


it returns:
zsh: command not found: pip

thanks

@pickle_rick:
Are you running with Spotify or Music?

@ka_ho_Ng:
Can you try running without Chrome in the background and let me know if that changes anything?

@Future_Face:
Sounds like you need to install pip and/or Python.

@nemobushido thanks, but ive installed python 3
Last login: Mon Jun 8 17:07:21 on ttys001

samhumphreys@Ruths-MacBook-Pro ~ % python3

Python 3.8.3 (v3.8.3:6f8c8320e9, May 13 2020, 16:29:34)

[Clang 6.0 (clang-600.0.57)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>>

You can have Python3 installed without pip.

Can you check also that you're using pip and not pip3?

If you're sure pip/pip3 is installed, it may be that your PATH isn't configured in your environment variables.

Spotify

ok, I tried to download pip, then did the command pip install osascript again

samhumphreys@Ruths-MacBook-Pro ~ % curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1825k  100 1825k    0     0  5275k      0 --:--:-- --:--:-- --:--:-- 5275k
samhumphreys@Ruths-MacBook-Pro ~ % python get-pip.py
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
Collecting pip
  Using cached pip-20.1.1-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.1.1
    Uninstalling pip-20.1.1:
      Successfully uninstalled pip-20.1.1
  WARNING: The scripts pip, pip2 and pip2.7 are installed in '/Users/samhumphreys/Library/Python/2.7/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-20.1.1
samhumphreys@Ruths-MacBook-Pro ~ % pip install osascript
zsh: command not found: pip
samhumphreys@Ruths-MacBook-Pro ~ %

@nemobushido bump

Imprint | Privacy Policy