It was pretty easy to get this far:
var with_out_ext=current_file.substring(0, current_file.lastIndexOf(“.”));
case “.cpp”: ext = “.h”; break;
case “.h”: ext = “.cpp”; break;
editor.OpenFile(with_out_ext+ext, 0, eeOpenAllowNewWindow);
But I haven’t found where to get the list of extensions from the current configuration. I’m also not sure how to test if the file exists (so I can try the next file extension if it does not exist).