Location: PHPKode > projects > WINR - An iTunes Net Remote > WINR/scripts/message.php
<?php
	////
	// 
	// message.php
	// This file does the actual controlling of iTunes
	// 
	// Copyright (c) 2006 Sean Healy, licensed under The BSD License
	//
	////

	switch($_GET['msg'])
	{
		case "playPause":
			shell_exec("osascript -e 'tell application \"iTunes\" to playpause'");
		break;
		case "nextTrack":
			shell_exec("osascript -e 'tell application \"iTunes\" to next track'");
		break;
		case "previousTrack":
			shell_exec("osascript -e 'tell application \"iTunes\" to previous track'");
		break;
		case "playTrack":
			$args = $_GET['args'];
			// TODO we are not always in the library
			shell_exec("osascript -e 'tell application \"iTunes\" to play (track $args of current playlist)'");
		break;
	}
?>
Return current item: WINR - An iTunes Net Remote