Mattrne
10-29-2003, 11:25 AM
I'm trying to write a little script to pop up a file dialog box which will allow a user to pick a mel file from a folder and then have the script source this mel file. Unfortunately, me being me, it aint working properly!
This is what I have;
global proc string getMel()
{
string $file = `fileDialog -directoryMask "q:/g2_eyetronics/mel/*.mel"`;
return $file;
print $file;
source $file;
}
getMel;
Now it pops up the file dialog box and allows me to pick a mel file, which is fine. However, it doesn't appear to do the print command or anything else. If I manually run the print line it gives me the correct path and filename contained in the $file variable.
What do I need to do to get this working? Also, presumably if the print is printing the contents of $file then I could do the source bit on there and it would source the user specified script?
Any help would be cool!
Cheers,
Matt.
This is what I have;
global proc string getMel()
{
string $file = `fileDialog -directoryMask "q:/g2_eyetronics/mel/*.mel"`;
return $file;
print $file;
source $file;
}
getMel;
Now it pops up the file dialog box and allows me to pick a mel file, which is fine. However, it doesn't appear to do the print command or anything else. If I manually run the print line it gives me the correct path and filename contained in the $file variable.
What do I need to do to get this working? Also, presumably if the print is printing the contents of $file then I could do the source bit on there and it would source the user specified script?
Any help would be cool!
Cheers,
Matt.
