I couldn't find any internal/script command or modifier to escape backslashes in paths, like for in JScript, but I highly doubt doing something like this is the best and cleanest way to go:
String(clickData.func.sourcetab.selected_files[0]).replace(/\\/g,"\\\\")
// or if the file already is in a variable:
String(file).replace(/\\/g,"\\\\")
Any better and cleaner solution? On one hand I'm afraid and on the other hand I really hope that I missed something.