« MEL: Setting the value of a Slim attribute | Home | The importance of having an efficient pipeline »
MEL: Find and edit the source of a procedure
By nikos | September 23, 2008
The following script opens a MEL file in a text editor by checking where queried procedure is stored. As an example Notepad is used for Windows and Nedit for Linux.
Usage:
edit “procname”
Limitations:
The script only finds global procedures that have already been sourced
global proc edit( string $file ) {
-
string $result = `whatIs $file`;
-
string $buffer[];
-
tokenize( $result, " ", $buffer );
-
-
if (`about -linux`){
-
exec( "nedit " + $buffer[ size($buffer) – 1 ] );
-
}
-
else if (`about -nt`){
-
exec( "notepad " + $buffer[ size($buffer) – 1 ] );
-
}
-
}
Topics: Maya | No Comments »
Comments are closed.