Photoshop - Javascript Split() Not Working

Hi, I am writing a script for Photoshop CS in Javascript. Part of the script needs to take in a string variable (which is a filename in this case) and split it up into two components (the filename and its extension). For example, I need to take the string variable TEST.jpg and split it up into two array variables TEST and jpg. The code I am currently using to do this is as follows:

[size=2]var fileRefSplit = fileRef.split(".");
var fileName = fileRefSplit[0];
var extnName = fileRefSplit[1];

The problem is when I run the script in Photoshop CS I get an error stating “fileRef.split(”.") is not a function."

Is there an error with my code or does Photoshop CS scripting just not support the Javascript Split() function? Also, is there another way to split up a string variable in Javascript besides using the Split() function?

Any help is greatly appreciated.

[/size]