Now i see what you are trying to do..
First of all
“if (plugins.file.jsfile.exists(filepath))”
is not legal code.. you can’t have moved that at onces yes?
the jsfile node.. is a return type node. You can use those methods under jsfile only for things that are returned as a JSFile (or array of JSfiles) by the plugin it self..
see my code:
var contents = plugins.file.getFolderContents(“c:/temp”);
for(var p=0;p<contents.length;p++)
{
application.output(contents[p] + " " + contents[p].exists());
}
the method getFolderContents will return a array of JSFile objects then you can use the methods under the JSFile node in the method editor tree.
This i do with contents[p].exists() (remember i have to do [p] because i didn’t return directly a JSFile but an array of JSFiles…
now what you are trying to do is calling those jsfile functions on nothing or on a string.. With a nothing i mean “plugins.file.jsfile” that plugins.file doesn’t have a jsfile property.. so you can’t say: “plugins.file.jsfile”
But i made a change, because what you want is that you have a String object somewhere and you want to test if that string as a file exisits…
now i made a new method convertStringToJSFile(string filename)
that will return a JSFile representation of the given string…
so you can do this in the next version of servoy:
“plugins.file.convertStringToJSFile(filepath).exists())”
Then it will work fine.