- SOURCE AVAILABILITY
- COPYRIGHT AND LICENSE
Mac::iTunes::AppleScript - control iTunes from Perl
use Mac::iTunes; my $itunes = Mac::iTunes->controller; $itunes->activate; $itunes->play; $itunes->quit;
**This module is unmaintained**
Returns a singleton object that can control iTunes.
Start playing the current selection
Toggle the play-pause button. If it's on play, it will pause, and if it's on pause, it will play.
- next, next_track
Skip to the next track
- previous, previous_track
Skip to the previous track
- redo, back_track
Go back to the start of the current track
Fast forward through the current selection.
Rewind through the current selection.
Start playing after fast forward or rewind
- open_url( URL )
Open an item from the given URL
- add_track( FILE, PLAYLIST_NAME )
Add the unix style path FILE to the user playlist with name PLAYLIST_NAME. Relative paths are resolved according to the current working directory.
add_track( 'mp3/song.mp3', 'Favorites' )
This function will create the playlist if it does not exist.
This function does not check if the track already exists in the playlist. If it does, you end up with duplicates.
Returns true if the file is already in the iTunes library.
The library actually stores aliases to the real files, so I can't simply check the file names---very frustrating.
- get_track_at_position( POSITION [, PLAYLIST ] )
- play_track( POSITION, [, PLAYLIST ] )
- get_track_names_in_playlist( [ PLAYLIST ] )
Return an anonymous array of the names of the tracks in playlist PLAYLIST.
Uses the currently set playlist if you don't specify one.
Return an anonymous array of the names of the playlists.
- set_playlist( NAME )
Set the current controller playlist.
Returns true if it succeeds, and false otherwise (for instance, if the playlist does not exist.
- add_playlist( NAME )
Add a playlist with the name NAME. Any double-quotes in NAME become single quotes.
- delete_playlist( NAME )
Delete all playlists with the name NAME.
- playlist_exists( NAME )
Returns the number of playlists with name NAME.
- browser_window_visible( [TRUE|FALSE] )
- eq_window_visible( [TRUE|FALSE] )
Returns the value of the visible property of the window. A window is visible if it is not minimized.
- tell( COMMAND )
The tell() method runs a simple applescript.
If the ITUNES_TELL environment variable is set to a true value, it prints the script to SDTERR before it runs it.
Returns the state of the iTunes application, represented by one of the following symbolic constants:
STOPPED PLAYING PAUSED FAST_FORWARDING REWINDING
This source is in GitHub:
brian d foy,
Copyright (c) 2002-2007 brian d foy. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.