ERROR: Primitive ' FileOpen' failed. Wrong type.

If you try and open a nonexistent file for reading:

( var f = "filename_that_doesn't_exist"; x = File.open(f) )

...you'll get this "wrong type" error. Maybe check that the file exists first:

( var f = "filename_that_doesn't_exist"; if(File.exists(f)){	x = File.open(f) }{	"file not found".warn;	// or do something cleverer } )