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

iTunes commands not working on macOS 10.15.6 #155

Open
pbnj opened this issue Aug 3, 2020 · 4 comments
Open

iTunes commands not working on macOS 10.15.6 #155

pbnj opened this issue Aug 3, 2020 · 4 comments
Labels

Comments

@pbnj
Copy link
Contributor

pbnj commented Aug 3, 2020

Bug Report

Since the introduction of Apple Music app on macOS, I believe the iTunes commands have stopped working.

Reproduction Steps

$ m itunes status
29:41: syntax error: A identifier can’t go after this identifier. (-2740)
iTunes is currently .
/usr/local/Cellar/m-cli/0.2.5/plugins/itunes: line 30: [: =: unary operator expected

Proposed Resolution

Fortunately, I think the solution is as simple as replacing instances of iTunes in osascripts to Music.

$ osascript -e 'tell application "iTunes" to artist of current track as string'
39:52: syntax error: A identifier can’t go after this identifier. (-2740)

$ ^iTunes^Music
osascript -e 'tell application "Music" to artist of current track as string'
Michael St Laurent

I will continue to test iTunes commands and submit a patch, including to replace m itunes with m music subcommand.

Info

$ m info
ProductName:    Mac OS X
ProductVersion: 10.15.6
BuildVersion:   19G73
@XNinety9
Copy link

XNinety9 commented Oct 3, 2020

Same issue here:

$ m itunes vol 0
35:41: execution error: The variable volume is not defined. (-2753)
39:45: execution error: The variable volume is not defined. (-2753)

$ m itunes vol up
35:41: execution error: The variable volume is not defined. (-2753)
39:45: execution error: The variable volume is not defined. (-2753)

@XNinety9
Copy link

XNinety9 commented Oct 3, 2020

I think I found the issue. In m-cli's source, the app is references as "iTunes", but has be renamed in Catalina to "Music".

Example:

osascript -e 'tell application "iTunes" to sound volume as integer'

will fail where

osascript -e 'tell application "Music" to sound volume as integer'

succeeds.

@VishalBilagi
Copy link

Created a PR #158 to fix this problem in MacOS Catalina and above.
Made a copy of iTunes plugin and renamed 'itunes' to 'music'

@bensleveritt
Copy link
Collaborator

Great work @VishalBilagi. Sorry it's taken time to get around to reviewing.

How would you feel about putting the two commands together under music, and eventually deprecate itunes?

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

No branches or pull requests

4 participants