all you need is a thorough look at the macro functions:
"Returns the last name in path's name sequence."
"Returns the parent of the file specified by path."
"Returns the index within string of the rightmost occurrence of substring."
substring(string, index1, index2);
"Returns a new string that is a substring of string. The substring begins at index1 and extends to the character at (index2 - 1)."
// A possible approach:
path = "/Users/pdubois/Desktop/myimage_raw.jpg";
dir = File.getParent(path) + "/";
name = File.getName(path);
name = substring(name, 0, lastIndexOf(name, "."));
However, there are other ways to perform the task.