shell script not working

ok so this is a piece of my code

set theSong to edittext(theSong)
	set theArtist to edittext(theArtist)

then i use 2 shell scripts: 1 for making everything lowercase, and another to take out any character that is not alphanumeric or a space.

on edittext(someText)
	return do shell script "/usr/bin/python -c \"import sys; print unicode(sys.argv[1], 'utf8').lower().encode('utf8')\" " & quoted form of someText
	-- Remove anything that is not alphanumeric or a space
	return do shell script "echo " & quoted form of someText & "/usr/bin/ruby -ne 'print $_.delete(\"^a-z\", \"^A-Z\", \"^0-9\", \"^ \")'"
end edittext

what this is for is it is part of a lyrics grabber. What my lyrics grabber does is goes to a specific website (www.lyricsdir.com) and gets the lyrics of the current song in iTunes and sticks it in a scroll view. It works almost perfectly except despite the fact that i did a shell script to take out everything thta isn’t alphanumeric or a space, songs that have punctuation still won’t work. (even though the shell script was supposed to take them out)

it looks like a pipe is missing to forward the output of echo to your ruby command:

return do shell script "echo " & quoted form of someText & " | /usr/bin/ruby -ne 'print $_.delete(\"^a-z\", \"^A-Z\", \"^0-9\", \"^ \")'"

works perfectly!:smiley: Thanks Dom!