```applescript
-- plays selected song or playlist directly (the Play Song v1 behavior)
-- for songs, this behavior continues playing music after the song finishes

on loadConfig()
	return (load script POSIX file (do shell script "./resources/compile-config.sh"))
end loadConfig

on run query
	set config to loadConfig()

	set typeAndId to parseResultQuery(query as text) of config
	set theType to type of typeAndId
	set theId to id of typeAndId

	tell application "iTunes"

		if theType is "song" then

			set theSong to getSong(theId) of config
			play theSong

		else if theType is "playlist" then

			set thePlaylist to getPlaylist(theId) of config
			play thePlaylist

		else

			log "Unknown type: " & theType

		end if

	end tell
end run
```

Fix bug where Apple Music playlists could not be played
user
```applescript
-- plays selected song or playlist directly (the Play Song v1 behavior)
-- for songs, this behavior continues playing music after the song finishes

on loadConfig()
	return (load script POSIX file (do shell script "./resources/compile-config.sh"))
end loadConfig

on run query
	set config to loadConfig()

	set typeAndId to parseResultQuery(query as text) of config
	set theType to type of typeAndId
	set theId to id of typeAndId

	tell application "iTunes"

		if theType is "song" then

			set theSong to getSong(theId) of config
			play theSong

		else if theType ends with "playlist" then

			set thePlaylist to getPlaylist(theId) of config
			play thePlaylist

		else

			log "Unknown type: " & theType

		end if

	end tell
end run
```
assistant