$command = $_GET['command']; switch ($command) { case "playpause":exec("osascript -e 'tell app \"iTunes\" to playpause'");break; case "next":exec("osascript -e 'tell app \"iTunes\" to next track'");break; case "prev":exec("osascript -e 'tell app \"iTunes\" to previous track'");breal; case "louder":exec("osascript -e 'tell app \"iTunes\" to set sound volume to sound volume + 10'");break; case "quieter":exec("osascript -e 'tell app \"iTunes\" to set sound volume to sound volume - 10'");break; case "mute":exec("osascript -e 'tell app \"iTunes\" to set mute to true'");break; case "unmute":exec("osascript -e 'tell app \"iTunes\" to set mute to false'");break; } $status = exec("osascript -e 'tell application \"iTunes\" to player state as string'"); $vol = exec("osascript -e 'tell app \"iTunes\" to sound volume as integer'"); $track = exec("osascript -e 'tell app \"iTunes\" to name of current track as string'"); $artist = exec("osascript -e 'tell app \"iTunes\" to artist of current track as string'"); $album = exec("osascript -e 'tell app \"iTunes\" to album of current track as string'"); ?>