Pythonista-Issues
Pythonista-Issues copied to clipboard
objc_util tutorial not work
I am learn this from doc,
from objc_util import *
MPMusicPlayerController = ObjCClass('MPMusicPlayerController') player = MPMusicPlayerController.systemMusicPlayer() now_playing = player.nowPlayingItem() if now_playing: artist = now_playing.valueForProperty_('artist') title = now_playing.valueForProperty_('title') print('Now playing: %s -- %s' % (artist, title)) else: print('No music playing')
this code not work, then I google it, from the omz forum I got this answer https://forum.omz-software.com/topic/5558/how-to-get-values-from-objcinstancemethodproxy but still not work!
item = player.nowPlayingItem()
print(item.title())
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/208B2CC1-1083-4195-904E-461AD503AA2D/Pythonista3/Documents/test.py", line 16, in