Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 04-03-2006, 02:58 PM   #1
zhvirus
Registered User
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to make Maya Menu Call extern program

i'v edited a mel script to add a menu to maya 6.5 on its startup.

what i want to know it that how can i Execute a external windows program
(for example, MS Word,or one written by myself) by clicking
the menu item.

can mel do this?
what about Maya API?

Who can help me?

thank you very much!
zhvirus is offline   Reply With Quote
Old 04-03-2006, 04:30 PM   #2
skywola
Registered User
 
skywola's Avatar
 
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
Thanks: 0
Thanked 0 Times in 0 Posts
Default

system("start C:/WINNT/NOTEPAD.EXE" );

Directly from the Maya reference library . . . keywords . . ."system command" . . .
__________________
"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
skywola is offline   Reply With Quote
Old 06-03-2006, 04:14 PM   #3
zhvirus
Registered User
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you !
but i still met some problem.....

it did work if i type

system("start c:\xxx\xxx.exe") in script editor

but when i put this command in my menu .mel script
like this:

global string $gMainWindow;
setParent $gMainWindow;

menu -label "Farrender";
menuItem -label "start Clent" -command "system("start c:\\xxx\\xxx.exe")";

it would even make the menu fail to create;

i thought i must be the string problem after "-command"

so i changed the last line to:

menuItem -label "start Client" -command "system(\"start c:\\xxx\\xxx.exe\")";


this time ,menu create successfully!
but when i click the menu item "start Client"
nothing happen!
no error information.....no effect...

i 'm puzzled

any kind man or woman who can help me?

Last edited by zhvirus : 06-03-2006 at 04:16 PM.
zhvirus is offline   Reply With Quote
Old 06-03-2006, 08:39 PM   #4
skywola
Registered User
 
skywola's Avatar
 
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is just a guess. because I do not have the code to try it out, but I would try this:


string $startExe = "system(\"start c:\\xxx\\xxx.exe\")";

menuItem -label "start Client" -command $startExe;


or if that does not work you might try:

string $startExe = "system(start c:\\xxx\\xxx.exe)";

menuItem -label "start Client" -command $startExe;


The backslash does not look right, it may have worked, but it looks more correct in the last example I listed. It may not even be needed.

Working with strings is a lot of fun . . . :headbang: Best bet when you get into trouble with ANY Maya commands is refer to the reference library or look online for example code.
__________________
"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
skywola is offline   Reply With Quote
Old 07-03-2006, 05:51 AM   #5
zhvirus
Registered User
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

haha
i understand now

when we type directly in script editor

we type:
c:\\xxx\\xxx.exe

so in string we'd type like this

c:\\\\xxx\\\\xxx.exe

thank you for your help :attn:
zhvirus is offline   Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Maya Hair/Polygon Error ingram_no.7 Members Lounge 13 10-12-2010 11:27 AM
Simply Maya Resources Online Miss_Nova Site News & Announcements 1 08-12-2010 09:36 PM
LayoutTools for Maya 2011 is here... ctbram Members Lounge 1 06-12-2010 11:32 PM
Open a Lightwave file in Maya 2011 radiant777 Maya Basics & Newbie Lounge 2 04-12-2010 03:45 AM

Thread Tools





A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.