weda82
Apr 01, 2019 - 19:40
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.