Module Import alias Import alias Import alias Import alias Import alias Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str FunctionDef arguments args defaults body Expr Str If UnaryOpNot Call NameLoad body Return NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Str Str NameLoad keyword AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args defaults body Expr Str If UnaryOpNot Call NameLoad body Return NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Str Str NameLoad keyword AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args defaults body Expr Str If UnaryOpNot Call NameLoad body Return NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Str Str NameLoad keyword AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If UnaryOpNot Call AttributeLoad NameLoad attr body Return NameLoad If BoolOpAnd NameLoad UnaryOpNot NameLoad UnaryOpNot NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Str Str BinOpMod NameLoad TupleLoad NameLoad NameLoad NameLoad keyword AttributeLoad NameLoad attr attr If NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad orelse Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str orelse If BoolOpAnd NameLoad NameLoad UnaryOpNot NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Str Str BinOpMod NameLoad TupleLoad NameLoad NameLoad NameLoad NameLoad keyword AttributeLoad NameLoad attr attr If NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad orelse Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str orelse If BoolOpAnd NameLoad NameLoad UnaryOpNot NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Str Str BinOpMod NameLoad TupleLoad NameLoad NameLoad keyword AttributeLoad NameLoad attr attr If NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad orelse Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str orelse If BoolOpAnd NameLoad UnaryOpNot NameLoad UnaryOpNot NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Str Str BinOpMod NameLoad NameLoad keyword AttributeLoad NameLoad attr attr If NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad orelse Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str orelse If BoolOpAnd NameLoad UnaryOpNot NameLoad UnaryOpNot NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad Str Str BinOpMod NameLoad NameLoad keyword AttributeLoad NameLoad attr attr If NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad orelse Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str decorator_list
N/A N/A speech N/A subprocess N/A os N/A platform N/A settings N/A DEFAULT_ITUNES_PLAY tell application "iTunes"
	set playlistName to "hallie song queue"
	--Check to see if song exists
	set songResults to (every file track of playlist "Library" whose name contains "%s")
	if not songResults = {} then
		set song to item 1 of songResults
		play song
		return get name of song & " by " & (get artist of song)
	else
		--Check to see if it's an artist
		set artistResults to (every file track of playlist "Library" whose artist contains "%s")
		if not artistResults = {} then
			set song to item 1 of artistResults
			if user playlist playlistName exists then
				try
					delete tracks of user playlist playlistName
				end try
			else
				make new user playlist with properties {name:playlistName}
			end if
			
			try
				repeat with trk in artistResults
					duplicate trk to user playlist playlistName
				end repeat
			end try
			play the playlist named playlistName
			return get name of song & " by " & (get artist of song)
		else
			set albumResults to (every file track of playlist "Library" whose album contains "%s")
			if not albumResults = {} then
				set song to item 1 of albumResults
				if user playlist playlistName exists then
					try
						delete tracks of user playlist playlistName
					end try
				else
					make new user playlist with properties {name:playlistName}
				end if
				
				try
					repeat with trk in albumResults
						duplicate trk to user playlist playlistName
					end repeat
				end try
				play the playlist named playlistName
				return get album of song & " by " & (get artist of song)
			end if
		end if
	end if
end tell N/A ITUNES_SONG_AND_ARTIST tell application "iTunes"
	set playlistName to "hallie song queue"
	set songResults to (every file track of playlist "Library" whose name contains "%s" and artist contains "%s")
	if not songResults = {} then
		set song to item 1 of songResults
		play song
		return get name of song & " by " & (get artist of song)
	else
		set albumResults to (every file track of playlist "Library" whose album contains "%s" and artist contains "%s")
		if not albumResults = {} then
			set song to item 1 of albumResults
			if user playlist playlistName exists then
				try
					delete tracks of user playlist playlistName
				end try
			else
				make new user playlist with properties {name:playlistName}
			end if
			
			try
				repeat with trk in albumResults
					duplicate trk to user playlist playlistName
				end repeat
			end try
			play the playlist named playlistName
			return get album of song & " by " & (get artist of song)
		end if
	end if
end tell N/A ITUNES_ALBUM_AND_ARTIST tell application "iTunes"
	set playlistName to "hallie song queue"
	set albumResults to (every file track of playlist "Library" whose artist contains "%s" and album contains "%s")
	if not albumResults = {} then
		set song to item 1 of albumResults
		if user playlist playlistName exists then
			try
				delete tracks of user playlist playlistName
			end try
		else
			make new user playlist with properties {name:playlistName}
		end if
		
		try
			repeat with trk in albumResults
				duplicate trk to user playlist playlistName
			end repeat
		end try
		play the playlist named playlistName
		return get album of song & " by " & (get artist of song)
	end if
end tell N/A ITUNES_ALBUM tell application "iTunes"
	set playlistName to "hallie song queue"
	set albumResults to (every file track of playlist "Library" whose album contains "%s")
	if not albumResults = {} then
		set song to item 1 of albumResults
		if user playlist playlistName exists then
			try
				delete tracks of user playlist playlistName
			end try
		else
			make new user playlist with properties {name:playlistName}
		end if
		
		try
			repeat with trk in albumResults
				duplicate trk to user playlist playlistName
			end repeat
		end try
		play the playlist named playlistName
		return get album of song & " by " & (get artist of song)
	end if
end tell N/A ITUNES_ARTIST tell application "iTunes"
	set playlistName to "hallie song queue"
	set artistResults to (every file track of playlist "Library" whose artist contains "%s")
	if not artistResults = {} then
		set song to item 1 of artistResults
		if user playlist playlistName exists then
			try
				delete tracks of user playlist playlistName
			end try
		else
			make new user playlist with properties {name:playlistName}
		end if
		
		try
			repeat with trk in artistResults
				duplicate trk to user playlist playlistName
			end repeat
		end try
		play the playlist named playlistName
		return get artist of song
	end if
end tell N/A SKIP tell application "iTunes"
next track
end tell N/A PAUSE tell application "iTunes"
pause
end tell N/A RESUME tell application "iTunes"
playpause
end tell pause N/A N/A N/A N/A N/A Tell iTunes to pause N/A N/A N/A platformCompatible N/A N/A False N/A N/A output error N/A N/A N/A N/A subprocess Popen N/A osascript -e PAUSE stdout N/A subprocess PIPE communicate N/A resume N/A N/A N/A N/A N/A Tell iTunes to resume N/A N/A N/A platformCompatible N/A N/A False N/A N/A output error N/A N/A N/A N/A subprocess Popen N/A osascript -e RESUME stdout N/A subprocess PIPE communicate N/A skip N/A N/A N/A N/A N/A Tell iTunes to skip a song N/A N/A N/A platformCompatible N/A N/A False N/A N/A output error N/A N/A N/A N/A subprocess Popen N/A osascript -e SKIP stdout N/A subprocess PIPE communicate N/A play N/A N/A song artist album N/A None None N/A N/A Tells iTunes to play a given song/artist/album - MACOSX ONLY N/A N/A N/A N/A settings platformCompatible N/A N/A False N/A N/A song N/A artist N/A album N/A N/A N/A output error N/A N/A N/A N/A subprocess Popen N/A osascript -e N/A DEFAULT_ITUNES_PLAY N/A song song song stdout N/A subprocess PIPE communicate N/A output N/A N/A N/A N/A speech speak N/A Playing  output N/A N/A N/A N/A speech speak N/A N/A Unable to find  song  in your library. N/A N/A N/A song artist N/A album N/A N/A N/A output error N/A N/A N/A N/A subprocess Popen N/A osascript -e N/A ITUNES_SONG_AND_ARTIST N/A song artist song artist stdout N/A subprocess PIPE communicate N/A output N/A N/A N/A N/A speech speak N/A Playing  output N/A N/A N/A N/A speech speak N/A N/A Unable to find  song  in your library. N/A N/A N/A album artist N/A song N/A N/A N/A output error N/A N/A N/A N/A subprocess Popen N/A osascript -e N/A ITUNES_ALBUM_AND_ARTIST N/A artist album stdout N/A subprocess PIPE communicate N/A output N/A N/A N/A N/A speech speak N/A Playing  output N/A N/A N/A N/A speech speak N/A N/A Unable to find  song  in your library. N/A N/A N/A album N/A artist N/A song N/A N/A N/A output error N/A N/A N/A N/A subprocess Popen N/A osascript -e N/A ITUNES_ALBUM album stdout N/A subprocess PIPE communicate N/A output N/A N/A N/A N/A speech speak N/A Playing  output N/A N/A N/A N/A speech speak N/A N/A Unable to find  song  in your library. N/A N/A N/A artist N/A album N/A song N/A N/A N/A output error N/A N/A N/A N/A subprocess Popen N/A osascript -e N/A ITUNES_ARTIST artist stdout N/A subprocess PIPE communicate N/A output N/A N/A N/A N/A speech speak N/A Playing  output N/A N/A N/A N/A speech speak N/A N/A Unable to find  song  in your library. N/A