PDA

View Full Version : Can i call windows programs - like UltraEdit for example with a mel script?


StefanStavrev
08-22-2006, 05:02 AM
Can i call windows programs - like UltraEdit for example with a mel script?

NateH
08-22-2006, 05:48 AM
Its easy to startup windows apps from within maya, just use the system command:

system("calc");
//opens windows calculator
system("ipconfig");
//runs ipconfig, since this run from command prompt normally it's return value will be returned
//to maya
system("C:/WINDOWS/system32/mspaint.exe");
//this has the full windows path (note: use the forward slash in maya, since back slash is an
//escape char in MEL

StefanStavrev
08-22-2006, 06:34 AM
Edit : There is a problem

After i excecute this :

system "C://UltraEdit-32";

it says :

operable program or batch file.

NateH
08-22-2006, 06:51 AM
try using start in there and make sure you escape out the double quotes...
system("start \"C:/Program Files/Trillian/trillian.exe\"");

//or use this way to escape out the escapes
system("start \"C:\\Program Files\\Trillian\\trillian.exe\"");
//this also worked
system("start C:\\Program Files\\Trillian\\trillian.exe");

StefanStavrev
08-22-2006, 07:08 AM
Both these ways ... it does apsolutely nothing... not even error... :)

azshall
08-22-2006, 03:53 PM
I don't particularly care for the system command. As it seems like every time I execute something through it, Maya freezes until I close that application that has been called.

Try using the 'exec' command. It shouldn't affect Maya (like I've noticed the system command to) and will do relatively the same thing. I use Crimson Editor and I always call it from within Maya... Here is the command I run from the shelf..

exec "C:/PROGRA~1/CRIMSO~1/cedt.exe";

Notice how the folders that have spaces in them .. I've replaced with the old DOS ~1 trick ... exec does not like spaces and cannot execute (as far as I've found). So make sure you do THAT method, (unless you find a way to make it work with spaces.. please post!)

Seth

CGTalk Moderation
08-22-2006, 03:53 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.