Skip to main content

python + iTunes.app (MacOS)

Project description

Installation

$ [sudo] pip install itunes

Functions

function __doc__
itunes.activate() open iTunes and make it frontmost
itunes.frontmost() return True if iTunes.app is frontmost app, else False
itunes.kill()
itunes.mute() mute iTunes
itunes.muted() return True if iTunes muted, else False
itunes.next() play next track
itunes.pid() return iTunes.app pid
itunes.prev() play previous track
itunes.quit() Quit iTunes
itunes.state() return player state string
itunes.stop() stop
itunes.tell(code) execute applescript tell application "iTunes" ...
itunes.unmute() unmute iTunes
itunes.helper.tell(code)
itunes.playlists.names()
itunes.playlists.play(playlist_name)
itunes.tracks.play(track, playlist)
itunes.volume.change(value)
itunes.volume.get()

Examples

vlc.tell(applescript) - execute applescript tell application "VLC" ...

>>> itunes.tell('play')
>>> itunes.play()
>>> itunes.pause()
>>> itunes.stop()
>>> itunes.next()
>>> itunes.prev()

playlists

>>> itunes.playlists.names()
["playlist1","playlist2"]

>>> itunes.playlists.play("playlist1")

play_track

>>> itunes.tracks.play("track_name","playlist")

volume

>>> itunes.volume.change(10)
>>> itunes.volume.get()
10

mute

>>> itunes.mute()
>>> itunes.muted()
True
>>> itunes.unmute()

process

>>> itunes.pid()
7654
>>> itunes.kill()

python-readme-generator

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

itunes-2019.4.13.tar.gz (2.6 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page