  | | | Mel SYSTEM calls | Mel SYSTEM calls 2003-12-04 - By Andy Rawling
Back Check how you're getting that $workSpace variable. Maya on windows uses unix-style ('/') directory delimiters internaly, rather than ms-dos style escape characters ('\') - and if you pass a unix path through to a DOS comand, it's going to think you're setting bad options. The 'toNativePath' command should sort you out.
Last time I used 'start' I think I had to double-escape the DOS delimiters to get them passed through ok: syetem( "start C:\\\\PROGRA~1\\\\BLAH.EXE" ); rather than just system( "C:\\PROGRA~1\\BLAH.EXE 2>NUL" ); could be wrong though - that was some time ago.
- Andy
Dobson, Jeff wrote:
>The system command should appear in quotes (") as opposed to ticks "`" in >this case. Of course that means you will have to wrestle with escape >characters to get the quotes within quotes syntax correct. I find it >easiest to first build my command in string and then feed it to the system >command. That bails me out of a lot of syntax trial and error. > >string $callCmp = "start cmpPackage.exe " + $workSpace + " >directory\\fileName.ext"; >print ($callCmp + "\n"); //This is a debug line so the script ed will show >you exactly what you are feeding to the system command >system ($callCmp); > >It has been a while since I have done this, though. You might need to >include "system" in the string and eval the string instead. > >--JeffD > >-- --Original Message-- -- >From: Brian Bullock [mailto:Brian@(protected)] >Sent: Wednesday, December 03, 2003 9:27 AM >To: maya@(protected) >Subject: Mel SYSTEM calls > > > > >I'm trying to write a mel script that will open a cmp file based on the >workSpace variable and a set cmp name. > > >EG: > >system ('start cmpPackage.exe " + $workSpace + "directory\\fileName.ext'); > > >I'm trying to run the script off the top of my head and there maybe syntax >problems, but hopefully you get the point... > > >Any ideas? > > >-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- >List-help: <mailto:listar@(protected)?Subject=help> >List-unsubscribe: <http://www.highend3d.com/maya/listserver/> >List-subscribe: <http://www.highend3d.com/maya/listserver/> >List-archive: <http://www.highend3d.com/maya/archive/> > >-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- >List-help: <mailto:listar@(protected)?Subject=help> >List-unsubscribe: <http://www.highend3d.com/maya/listserver/> >List-subscribe: <http://www.highend3d.com/maya/listserver/> >List-archive: <http://www.highend3d.com/maya/archive/> > > >
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- List-help: <mailto:listar@(protected)?Subject=help> List-unsubscribe: <http://www.highend3d.com/maya/listserver/> List-subscribe: <http://www.highend3d.com/maya/listserver/> List-archive: <http://www.highend3d.com/maya/archive/>
|
|
 |