get drag&drop MEL script path
Save this MEL code as a .mel
file.
Drag & drop it in Maya to print the path of the script.
global proc FindMe() {}
print("whatIs result -> " + `whatIs "FindMe"` + "\n");
// Mel procedure found in: C:/Folder/test.mel
Since it returns a string starting with
Mel procedure found in:
, we have to do some cleanup.string $melScriptDir = `substitute "Mel procedure found in: " $melScriptPath ""`;
print($melScriptDir + "\n")
// C:/Folder/test.mel
to get the parent folder