The problem is that you can't leave unescaped quotes in a single-quoted string, as you do when you put quotes around the words file and folder. Try it with a triple-quoted string, which allows unescaped quotes within it (it is only terminated by a second triple of quotes):
s"""select ${if (isF) "file" else "folder"} "${abs.getName}" of folder"""