omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. weda82

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 5
    • Best 1
    • Controversial 0
    • Groups 0

    weda82

    @weda82

    1
    Reputation
    740
    Profile views
    5
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    weda82 Unfollow Follow

    Best posts made by weda82

    • RE: Play music in Apple Music App

      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
      weda82
      weda82

    Latest posts made by weda82

    • Run HomeKit scene without using the Shortcuts app

      Hi

      I am looking for a way to run a HomeKit scene from a Pythonista script.
      I know I could do it, using the Apple's Shortcuts app. But this approach is problematic, when I want to execute two scenes from a script. The problem seems to be passing the execution flow from the Shortcuts app back to my Pythonista script and continue it's execution. When I call my Pythonista script from the Shortcuts app, then the Shortcuts app waits for my script to finish. During the waiting I can not call another shortcut.

      So I was wondering if there might be a way to run HomeKit scenes without the indirection of using the Shortcuts app.

      I found this post: https://forum.omz-software.com/topic/4696/homekit/4, but it's two years old.

      Any ideas?

      Thank you very much

      posted in Pythonista
      weda82
      weda82
    • RE: How to get values from "ObjCInstanceMethodProxy"

      @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
      weda82
      weda82
    • How to get values from "ObjCInstanceMethodProxy"

      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
      weda82
      weda82
    • RE: Play music in Apple Music App

      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
      weda82
      weda82
    • Play music in Apple Music App

      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
      weda82
      weda82