Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Add playlist control to the script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Add playlist control to the script
Authored by: kahless on Dec 18, '03 02:43:57PM
One more suggestion. Add the ability to choose a playlist. I added an itunes playlist "name of playlist" command. Here is the code I added to the original script. Add
echo " playlist "@" = Play iTunes' playlist named @";
to the showHelp and add
"playlist" ) echo "Changing iTunes playlist."; osascript -e 'tell application "iTunes"' -e "set the new_playlist to \"$2\" as string" -e "play playlist new_playlist" -e "end tell"; break ;;
in the main body of the script. I put it after the vol command.

[ Reply to This | # ]
Add playlist control to the script (correction)
Authored by: kahless on Mar 09, '04 01:24:22PM
The quotes around $2 need to be escaped as \"$2\".

[ Reply to This | # ]
Add playlist control to the script
Authored by: the.hudi on Jun 18, '08 05:10:54AM
another suggestion: For the help:

echo " playlist = Show playlists saved in iTunes.";
And the code for showing available playlists, if there is no parameter given.

## addition playlist of choice
"playlist" )
if [ -n "$2" ]; then
echo "Changing iTunes playlists to '$2'.";
osascript -e 'tell application "iTunes"' -e "set new_playlist to \"$2\" as string" -e "play playlist new_playlist" -e "end tell"; 
break ;
else
# Show available iTunes playlists.
echo "Playlists:";
osascript -e 'tell application "iTunes"' -e "set allPlaylists to (get name of every playlist)" -e "end tell";
break;
fi
break;;


[ Reply to This | # ]