Pe8er / Playbox.widget

93 stars 25 forks source link

Not working at all with MacOS Catalina #31

Open ChopstixCS opened 5 years ago

ChopstixCS commented 5 years ago

Script doesn't work as iTunes is now music app, also doesn't get spotify either. Most likely as Macintosh HD protects the OS with a read only volume now so System Events does not work. This is a theory.

ChopstixCS commented 5 years ago

Fixed it. PlayboxCatalina.widget.zip

Pe8er commented 5 years ago

I don't have Catalina yet. Will update the widget once I have it installed. Thanks for the fix!

apepindev commented 4 years ago

@ChopstixCS good job getting the script to work with Apple Music, although artwork isn't showing for me? I've allowed full disk access for Übersicht to locate and cache the images but even that didn't work.

Screenshot 2019-11-11 at 11 47 49

Log output from the get current track.scpt.

tell current application
    path to current application
        --> alias "Macintosh HD:Users:Username:Library:Application Support:Übersicht:widgets:Playbox.widget:lib:get current track.scpt"
end tell
tell application "System Events"
    get name of every process
        --> {"loginwindow", "ViewBridgeAuxiliary", "ControlStrip", "NotificationCenter", "Keychain Circle Notification", "WiFiAgent", "AppSSOAgent", "talagent", "ViewBridgeAuxiliary", "LocationMenu", "SoftwareUpdateNotificationManager", "MirrorDisplays", "imklaunchagent", "CoreLocationAgent", "EmojiFunctionRowIM_Extension", "PAH_Extension", "nbagent", "photolibraryd", "SystemUIServer", "Dock", "Spotlight", "QuickLookUIService", "Finder", "Google Chrome", "Siri", "AirPlayUIAgent", "TextInputMenuAgent", "garcon", "PopClip", "Dropbox", "com.apple.dock.extra", "StatusMenu", "PopClipHelper", "DropboxActivityProvider", "FinderSyncAPIExtension", "FinderSyncAPIExtension", "studentd", "SiriNCService", "coreautha", "OSDUIHelper", "PowerChime", "storeuid", "UIKitSystem", "FinderSyncAPIExtension", "com.apple.appkit.xpc.openAndSavePanelService", "QuickLookUIService", "FinderSyncAPIExtension", "FinderSyncAPIExtension", "FinderSyncAPIExtension", "garcon", "com.apple.appkit.xpc.openAndSavePanelService", "QuickLookUIService", "CalNCService", "universalAccessAuthWarn", "Music", "NowPlayingTouchUI", "System Events", "FolderActionsDispatcher", "CoreServicesUIAgent", "Übersicht", "iTerm2", "com.apple.WebKit.Networking", "com.apple.WebKit.WebContent", "Messages", "FinderSyncAPIExtension", "Script Editor", "FinderSyncAPIExtension", "screencaptureui"}
end tell
tell application "Music"
    get player state
        --> playing
end tell
tell application "System Events"
    get name of every process
        --> {"loginwindow", "ViewBridgeAuxiliary", "ControlStrip", "NotificationCenter", "Keychain Circle Notification", "WiFiAgent", "AppSSOAgent", "talagent", "ViewBridgeAuxiliary", "LocationMenu", "SoftwareUpdateNotificationManager", "MirrorDisplays", "imklaunchagent", "CoreLocationAgent", "EmojiFunctionRowIM_Extension", "PAH_Extension", "nbagent", "photolibraryd", "SystemUIServer", "Dock", "Spotlight", "QuickLookUIService", "Finder", "Google Chrome", "Siri", "AirPlayUIAgent", "TextInputMenuAgent", "garcon", "PopClip", "Dropbox", "com.apple.dock.extra", "StatusMenu", "PopClipHelper", "DropboxActivityProvider", "FinderSyncAPIExtension", "FinderSyncAPIExtension", "studentd", "SiriNCService", "coreautha", "OSDUIHelper", "PowerChime", "storeuid", "UIKitSystem", "FinderSyncAPIExtension", "com.apple.appkit.xpc.openAndSavePanelService", "QuickLookUIService", "FinderSyncAPIExtension", "FinderSyncAPIExtension", "FinderSyncAPIExtension", "garcon", "com.apple.appkit.xpc.openAndSavePanelService", "QuickLookUIService", "CalNCService", "universalAccessAuthWarn", "Music", "NowPlayingTouchUI", "System Events", "FolderActionsDispatcher", "CoreServicesUIAgent", "Übersicht", "iTerm2", "com.apple.WebKit.Networking", "com.apple.WebKit.WebContent", "Messages", "FinderSyncAPIExtension", "Script Editor", "FinderSyncAPIExtension", "screencaptureui"}
end tell
tell application "Music"
    get artist of current track
        --> "Able Baker Fox"
    get name of current track
        --> "Pennies on the Dollar"
    get album of current track
        --> "Visions"
    get duration of current track
        --> 169.807006835938
    get loved of current track
        --> false
    get player position
        --> 90.903999328613
end tell
tell application "System Events"
    make new property list item at end of every property list item of contents of property list file "/Users/Username/Library/Application Support/Übersicht/widgets/Playbox.widget/lib/songMeta.plist" with properties {kind:string, name:"currentPosition", value:"90"}
        --> property list item "currentPosition" of contents of property list file "Macintosh HD:Users:Username:Library:Application Support:Übersicht:widgets:Playbox.widget:lib:songMeta.plist"
    get value of property list item "artistName" of contents of property list file "/Users/Username/Library/Application Support/Übersicht/widgets/Playbox.widget/lib/songMeta.plist"
        --> "Able Baker Fox"
    get value of property list item "songName" of contents of property list file "/Users/Username/Library/Application Support/Übersicht/widgets/Playbox.widget/lib/songMeta.plist"
        --> "Pennies on the Dollar"
    make new property list item at end of every property list item of contents of property list file "/Users/Username/Library/Application Support/Übersicht/widgets/Playbox.widget/lib/songMeta.plist" with properties {kind:string, name:"songChanged", value:"false"}
        --> property list item "songChanged" of contents of property list file "Macintosh HD:Users:Username:Library:Application Support:Übersicht:widgets:Playbox.widget:lib:songMeta.plist"
    make new property list item at end of every property list item of contents of property list file "/Users/Username/Library/Application Support/Übersicht/widgets/Playbox.widget/lib/songMeta.plist" with properties {kind:string, name:"isLoved", value:"false"}
        --> property list item "isLoved" of contents of property list file "Macintosh HD:Users:Username:Library:Application Support:Übersicht:widgets:Playbox.widget:lib:songMeta.plist"
    get value of property list item "artistName" of contents of property list file "/Users/Username/Library/Application Support/Übersicht/widgets/Playbox.widget/lib/songMeta.plist"
        --> "Able Baker Fox"
    get value of property list item "songName" of contents of property list file "/Users/Username/Library/Application Support/Übersicht/widgets/Playbox.widget/lib/songMeta.plist"
        --> "Pennies on the Dollar"
    get value of property list item "albumName" of contents of property list file "/Users/Username/Library/Application Support/Übersicht/widgets/Playbox.widget/lib/songMeta.plist"
        --> "Visions"
    get value of property list item "songDuration" of contents of property list file "/Users/Username/Library/Application Support/Übersicht/widgets/Playbox.widget/lib/songMeta.plist"
        --> "169"
    get value of property list item "currentPosition" of contents of property list file "/Users/Username/Library/Application Support/Übersicht/widgets/Playbox.widget/lib/songMeta.plist"
        --> "90"
    get value of property list item "coverURL" of contents of property list file "/Users/Username/Library/Application Support/Übersicht/widgets/Playbox.widget/lib/songMeta.plist"
        --> "/Playbox.widget/lib/default.png"
    get value of property list item "songChanged" of contents of property list file "/Users/Username/Library/Application Support/Übersicht/widgets/Playbox.widget/lib/songMeta.plist"
        --> "false"
    get value of property list item "isLoved" of contents of property list file "/Users/Username/Library/Application Support/Übersicht/widgets/Playbox.widget/lib/songMeta.plist"
        --> "false"
end tell
Result:
"Able Baker Fox @ Pennies on the Dollar @ Visions @ 169 @ 90 @ /Playbox.widget/lib/default.png @ false @ false"
dionmunk commented 4 years ago

@Paradiddley Do you have Apple Music? If so, songs played using an Apple Music subscription won't have artwork. The artwork is stored differently for those tracks, and there isn't a way that I am aware of to get the album art from those tracks.

3raxton commented 4 years ago

Thanks for working on this @ChopstixCS. I've got some code that I added to the Catalina version of Playbox and would like to commit it. Should I commit directly to @Pe8er's repo, or would it be better for you to fork his repo and add the code that you wrote and have me add my code after that?

Alternatively, I could fork the Playbox repo, and I could add your code as well as mine, but I don't like the idea of committing your code when I didn't write it. I would love to know what both of you think.

ChopstixCS commented 4 years ago

Fork it

On Sun, Dec 1, 2019 at 1:18 AM Braxton Huff notifications@github.com wrote:

Thanks for working on this @ChopstixCS https://github.com/ChopstixCS. I've got some code that I added to the Catalina version of Playbox and would like to commit it. Should I commit directly to @Pe8er https://github.com/Pe8er's repo, or would it be better for you to fork his repo and add the code that you wrote and have me add my code after that?

Alternatively, I could fork the Playbox repo, and I could add your code as well as mine, but I don't like the idea of committing your code when I didn't write it. I would love to know what both of you think.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Pe8er/Playbox.widget/issues/31?email_source=notifications&email_token=AKD6M45N7FORVEQDIFYNMMLQWNJM5A5CNFSM4IDSWAL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFQ6IXI#issuecomment-560063581, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKD6M43JW63TUO7QOUYEVEDQWNJM5ANCNFSM4IDSWALQ .

3raxton commented 4 years ago

I want to make it clear that I will be submitting a pull request once I fork it. Just to confirm, you're comfortable with me committing your code as well as mine.

ChopstixCS commented 4 years ago

👍🏻 all I did was replace iTunes with music

On Sun, Dec 1, 2019 at 1:23 AM Braxton Huff notifications@github.com wrote:

I want to make it clear that I will be submitting a pull request once I fork it. Just to confirm, you're comfortable with me committing your code as well as mine.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Pe8er/Playbox.widget/issues/31?email_source=notifications&email_token=AKD6M44HP7UXFHHY4CJMHUTQWNJ7ZA5CNFSM4IDSWAL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFQ6LNA#issuecomment-560063924, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKD6M4YN67PPEZXZCFIUCQDQWNJ7ZANCNFSM4IDSWALQ .

3raxton commented 4 years ago

Great, will do. Cheers!

furkannurovic commented 1 year ago

Fixed it. PlayboxCatalina.widget.zip

However, after downloading the new widget, I ran into another problem that required granting necessary permissions to the application running the script. Here are the steps to follow to fix this issue:

Open System Preferences on your Mac. Click on Security & Privacy. Select the Privacy tab. Scroll down to Automation in the left sidebar and click on it. In the right pane, locate the application running the script and ensure it has a checkmark next to it. If the application is not listed, click on the lock icon in the lower left corner of the window, enter your administrator password, and then click the + button to add the application to the list. Once the application is added, make sure it has a checkmark next to it.