Here is my code:
importClass(Packages.ij.IJ);
var testText = IJ.openAsString("test.txt");
print("type of testText: " + (typeof testText));
print(testText);
The logged output is:
type of testText: object
Error: file not found
Why isn’t testText a string? What is the “file not found” error about?