PDA

View Full Version : scriptJob in Python


PozestStar
05-29-2012, 02:29 PM
:banghead: I am determined to get this!!

Anyway, I have something like this in MEL:
scriptJob -p ss_helpWin -uiDeleted ss_mainUI "deleteUI ss_helpWin";

Nothing fancy or schmancy. If the help window is open when I close the main UI, then it will also close the help window.

I'm trying to do the same thing in Python. I gave it my best, but I know what I've done is wrong. I've read the help docs, but I still don't understand what I'm doing wrong. Could someone tell me what I've done wrong and/or point me in the right direction?

mc.scriptJob(parent=ss_helpWin, uiDeleted=(ss_mainUI), mc.deleteUI(ss_helpWin))


Thanks!

NaughtyNathan
05-29-2012, 03:58 PM
I'm assuming (based on your MEL) that ss_helpWin and ss_mainUI are actually literal strings, and should be treated as such in python. also, if you look at the docs for scriptJob in python, the uid flag shows you that the parameters it requires are: [string,string]. Basically a list containing two strings, which is not what you have given.
Something like this:
mc.scriptJob(parent='ss_helpWin', uiDeleted=[ 'ss_mainUI' , 'mc.deleteUI("ss_helpWin")' ] )
although I haven't tested it! ;) Beware also though, that mc. may not be in the global namespace for your mc.deleteUI to work properly

CGTalk Moderation
05-29-2012, 03:58 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.