• weda82

    @mikael Thanks for your reply.
    You are right. I was missing the brackets at "nowPlayingItem". I already had them for title, but you need both.

    posted in Pythonista read more
  • weda82

    Hi

    I am trying to get the currently played item from Apples Music App. My code looks like this:

    from objc_util import *
    
    def main():
        NSBundle.bundleWithPath_(
            '/System/Library/Frameworks/MediaPlayer.framework').load()
    
        MPMusicPlayerController = ObjCClass('MPMusicPlayerController')
        MPMediaItem = ObjCClass('MPMediaItem')
        player = MPMusicPlayerController.systemMusicPlayer()
    
        item = player.nowPlayingItem
        print(item)
        print(item.title)
    
    main()
    

    My problem is, that I do not know how to get values from "nowPlayingItem". I get this exception:

    print(item.title)
    AttributeError: 'ObjCInstanceMethodProxy' object has no attribute 'title'
    

    I am thankful for any hints.

    posted in Pythonista read more
  • weda82

    Thank you for your ideas and I am sorry for my late reply.

    I tried the previous suggestion and I think the query is not working properly. If I iterate the query result it returns all my media items. But I also do not see the problem. As far as I understood the Apple documentation, it looks correct to my.

    I tried a different approach:

    from objc_util import *
    
    def main():
        NSBundle.bundleWithPath_(
            '/System/Library/Frameworks/MediaPlayer.framework').load()
    
        matchingItem = ["928428096"] # StoreId of "Songs of innocence"
        MPMusicPlayerController = ObjCClass('MPMusicPlayerController')
        player = MPMusicPlayerController.systemMusicPlayer()
        player.setQueueWithStoreIDs(matchingItem)
        player.play()
    
    
    main()
    

    I got the StoreId from this web site:
    https://linkmaker.itunes.apple.com/de-de

    This is working, but not as comfortable as I was looking for.

    posted in Pythonista read more
  • weda82

    Hello

    I am looking for a way to specify an existing album from my Music app and start playing it.

    Is this possible with Pythonista 3 on iOS 12?

    I appreciate any ideas or solutions.

    Thank you

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!