Use iTunes' Up Next function with an API
Is there a way to use iTunes’ Up Next function with an API?
I know that you can use Scripting Bridge, but it doesn’t cover any of the new functions of iTunes 11.
- Why is != NSClassFromString(NSStringFromClass()) on OS X?
- How to make NSSearchField send action upon autocompletion?
- How do I find information on other applications running on the computer on Mac/Cocoa/Obj-C?
- Failed to connect (storyboard) outlet from (NSApplication) to (NSNibExternalObjectPlaceholder) error in Cocoa and storyboard
- Compiler error: “initializer element is not a compile-time constant”
- Cocoa/Obj-C simple XML file reader - need help
Solutions Collect From Internet About “Use iTunes' Up Next function with an API”
iTunes has no public API but the scripting bridge
you could use Applesript UI Scripting I’d wager — but that would be very fragile
you can also simulate a keypress then:
That less fragile than scripting the visible interface (IMO):
TADA — YAY — a ‘ready’ script that will add songs selected to UpNext ::
tell application "AppleScript Utility" set GUI Scripting enabled to true end tell tell application "iTunes" --get the song set l to playlist "Purchased" set t to item 5 of tracks of l --focus it in list reveal t --show window activate end tell tell application "System Events" -- option enter delay 1 key down option delay 1 key code 36 key up option -- Click the “Play Song” button in the annoying dialog. set w to null try set w to window "Add to Up Next" of application process "iTunes" end try if w is not null then set b to UI element "Play Song" of w click b end if end tell
- how to replace/customize back button image in storyboard navigationcontroller
- Should I removeBehavior a UIPushBehavior — I am adding many pushes
- drawRect: How do I do an “inverted clip”
- Swift 1.2 optional external variable?
- Header Displaced in TableView with UIRefreshControl
- How do I rename a project in Xcode?
- Device build fails after upgrading to Xcode 8
- Core data, sorting one-to-many child objects
- How to detect the active iTunes store on the iPhone/iPod Touch/iPad?
- peak detection for growing time series using Swift
- iOS Swift – How to store array with Core Data?
- Protocol extension in Swift 3
- loading NSBundle files on iOS
- How to handle UserNotifications Actions in iOS 10
- Swift 2 JSON POST request